python练习

number= 23
running=True
while running:
    guess=int(raw_input('Enter an integer:'))
    if guess ==number:
        print'congratulations,you guessed it.'
        print"(But you do not win any prizes)"
        running=False
    elif guess<number:
        print'No.It is a little higher than that'
    else:
        print 'No.It is a little lower than that'
else:
    print'this while loop is over.'
print'Done'
在python中缩进是一个必须的步骤,并且要保证特别的严格,要不就会出现不一样的情况,可能出现语法错误,可能出现结果不对
展开阅读全文

没有更多推荐了,返回首页