【发布时间】:2015-08-12 04:17:35
【问题描述】:
from random import randint
x=(randint(0,9))
print "I'm thinking of a number between 1 and 10."
y = raw_input("What is your number? (Integer from 1 to 10)")
if y<x:
print "Too low!"
elif y>x:
print "Too high!"
elif y==x:
print "Spot On!"
sys.exit()
我如何循环它,所以你必须不断猜测直到你得到数字?
【问题讨论】: