mirror of
https://github.com/TheAlgorithms/Python.git
synced 2026-03-13 09:50:19 +08:00
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python * sort() --> sorted()
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
"""example of simple chaos machine"""
|
||||
from __future__ import print_function
|
||||
|
||||
try:
|
||||
input = raw_input # Python 2
|
||||
except NameError:
|
||||
pass # Python 3
|
||||
|
||||
# Chaos Machine (K, t, m)
|
||||
K = [0.33, 0.44, 0.55, 0.44, 0.33]; t = 3; m = 5
|
||||
@@ -96,7 +90,7 @@ message = random.sample(range(0xFFFFFFFF), 100)
|
||||
for chunk in message:
|
||||
push(chunk)
|
||||
|
||||
# for controlling
|
||||
# for controlling
|
||||
inp = ""
|
||||
|
||||
# Pulling Data (Output)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from __future__ import print_function
|
||||
|
||||
alphabets = [chr(i) for i in range(32, 126)]
|
||||
gear_one = [i for i in range(len(alphabets))]
|
||||
gear_two = [i for i in range(len(alphabets))]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from __future__ import print_function
|
||||
import math
|
||||
|
||||
|
||||
@@ -66,7 +65,7 @@ def getBlock(bitString):
|
||||
"""[summary]
|
||||
Iterator:
|
||||
Returns by each call a list of length 16 with the 32 bit
|
||||
integer blocks.
|
||||
integer blocks.
|
||||
|
||||
Arguments:
|
||||
bitString {[string]} -- [binary string >= 512]
|
||||
@@ -95,7 +94,7 @@ def not32(i):
|
||||
|
||||
def sum32(a, b):
|
||||
'''
|
||||
|
||||
|
||||
'''
|
||||
return (a + b) % 2**32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user