随机生成一个数字后,我检查用户的输入是否匹配。如果是,打印一行,如果不是,打印另一行。即使用户猜对了,另一行也会打印出来。
chosenNumber = input ("Choose a number: ")
int (chosenNumber)
diceRoll = random.randint (1,3)
print ("The number rolled is: ",diceRoll)
if diceRoll == chosenNumber:
print ("WINNER")
else:
print ("LOSER")
谢谢你的帮助。
目前没有回答
相关问题 更多 >
编程相关推荐