我的if语句有效,但其他人不能帮助我吗? 这是我的代码。顺便说一句,如果有人知道如何在一次之后要求重试会很棒!Python if else语句
import random
print('choose a number between 1 and 10,if you guess right you get 10 points if you guess wrong you lose 15points')
answer = input()
randint = random.randint(0,2)
print('the answer is ',randint)
if [answer == randint]:
print('gratz! you win 10points!')
else:
print('you lose 15points!')
这听起来像是功课... – purpletentacle
尝试删除if语句。 –
'randint'不是1到10之间的数字... –