0
我對python IDLE非常陌生,我的任務是製作一個遊戲,要求您猜測一個隨機數,這裏是我擁有的,但無論我輸入什麼,它都會返回「你太高「有一點幫助,非常感謝。嘗試混合while和raw_input命令
import random
i = random.randint(0,100)
print (i)
e = raw_input ("Guess what number I'm thinking of between 0 and 100!")
while e != i:
if i > e:
print "You were too low."
elif i < e:
print "You were too high."
e = raw_input ("Guess what number I'm thinking of between 0 and 100!")
if e == i:
print "yay"