【发布时间】:2014-08-29 20:04:27
【问题描述】:
我正在尝试编写一个while循环,这是我的代码(家庭作业是基本的):
import random
RandomNumber=(random.randint(0,100))
GuessedNumber=int(input("Guess any whole number between 0 and 100! "))
while RandomNumber != GuessedNumber:
if GuessedNumber==RandomNumber:
print("Well done you gessed correctly!")
else:
print("Unlucky guess again!")
如果有人知道我的 while 循环有什么问题,我们将不胜感激;谢谢。
【问题讨论】:
-
你有什么问题?
-
我不明白如何让我的 while 循环基本工作。
标签: python loops python-3.x while-loop