我试图在python终端中进行查询,但是当我尝试比较两个代码时,它说错了
import time
import random
def adventure():
key = random.randint(111,999)
delay = 1
print()
print("the code is", key)
time.sleep(delay)
uk = input("do you remember the code?")
if uk == key:
print("Good")
else:
print("wrong code")
编辑:因此解决方案不是
if uk == key:
执行此操作
if int(uk) == key:
答案 0 :(得分:1)