Skip to content

Commit ee3b0f2

Browse files
author
cclauss
authored
Properly define raw_input)( in Python 3
__raw_input()__ was removed in Python 3 in favor of __input()__. This change ensure similar functioning in both Python 2 and Python 3.
1 parent d4b4b7b commit ee3b0f2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

hashes/chaos_machine.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
from __future__ import print_function
33

44
try:
5-
raw_input
6-
input = raw_input
7-
except:
8-
pass
5+
raw_input # Python 2
6+
except NameError:
7+
input = raw_input # Python 3
98

109
# Chaos Machine (K, t, m)
1110
K = [0.33, 0.44, 0.55, 0.44, 0.33]; t = 3; m = 5

0 commit comments

Comments
 (0)