先貼~日後再整理 #File name:while.py

number=23
guess=int(raw_input('Enter an integer :'))
while guess !=number:
    if guess < number:
        print "You can try again,it is higher than that."
        guess=int(raw_input('Enter an integer :'))
    else:
        print "No, it is lower than that."
        guess=int(raw_input('Enter an integer :'))
print "Good!"

創作者介紹

胖虎的祕密基地

idobest 發表在 痞客邦 PIXNET 留言(0) 人氣()