新手课后作业4 不知道哪里出错了 求解
import randomtimes = 3
secret = random.randint(1,10)
print('让我们玩个游戏吧')
guess = 11
print('猜一下我心里想的数字是几:',end='')
while (guess != secret) and (time > 0):
temp = input()
guess = int(temp)
times = times -1
if guess == secret:
print('猜对了')
else:
if guess > secret:
print('大了')
else:
print('小了')
if times > 0:
print('再试一次吧', end='')
else:
print('机会用完了T_T')
print('游戏结束了')
import random
times = 3
secret = random.randint(1,10)
print('让我们玩个游戏吧')
guess = 11
print('猜一下我心里想的数字是几:',end='')
while (guess != secret) and (time > 0): 好像是我time 拼错了,少加了一个s{:5_104:}
temp = input()
guess = int(temp)
times = times -1
if guess == secret:
print('猜对了')
else:
if guess > secret:
print('大了')
else:
print('小了')
if times > 0:
print('再试一次吧', end='')
else:
print('机会用完了T_T')
print('游戏结束了')
就是少加个S,你点运行的时候就会提示你啊 自己解决的帖子,建议直接修改帖子类型为已解决
页:
[1]