python新手,尝试猜谜游戏。我正在使用pycharm。
继承人的代码后跟错误
这是我的代码代码:
import random
lucky number= random.randrange(1,100)
guess = int(input('guess the number in the range 1-100: '))
while guess != lucky number:
if guess < lucky number:
print ("too low, try higher")
guess = int(input("\n Guess a number between 1-100")
else:
print ("too high, try lower")
guess = int(input("\n Guess a number between 1-100"))
print ("you guessed the number correctly, Congratulations!")
import random
lucky number= random.randrange(1,100)
guess = int(input('guess the number in the range 1-100: '))
while guess != lucky number:
if guess < lucky number:
print ("too low, try higher")
guess = int(input("\n Guess a number between 1-100")
else:
print ("too high, try lower")
guess = int(input("\n Guess a number between 1-100"))
print ("you guessed the number correctly, Congratulations!")
这是错误:
Error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.3.4\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
stream = tokenize.open(file) # @UndefinedVariable
File "C:\Users\Shane McDonagh\AppData\Local\Programs\Python\Python38-32\lib\tokenize.py", line 392, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Shane McDonagh/.PyCharmCE2019.3/config/scratches/scratch_1.py'
12345678_0001
慕斯709654
青春有我
相关分类