我有一个python脚本执行不正确的数学运算。 这是:
from random import randint
while 1==1:
try:
exp = input()
if exp=="1+1":
print("=3")
else :
answer = exp
while answer == exp:
answer = randint(0, exp+10)
print(answer)
except Exception as e:
print(e)
print(259)
当我运行它时,我收到一个错误:
Traceback (most recent call last):
File "/Users/the_name_of_my_home_folder/Documents/the name of the file.py", line 1, in <module>
from random import randint
ImportError: bad magic number in 'random': b'\x03\xf3\r\n'
我在mac上使用python 3.5.1。