#/usr/bin/env pythoninput_number=19number1=0while number1 < 3: #==>次数限制循环 number=int(input("please input your number:")) #==>注意python3.0默认输入的是字符串,需要int转换 if number == input_number: break #==>条件满足时结束循环 elif number > input_number: print("the number you put is big") print("please input corret number") else: print("the number you put is small") print("please input corret number") number1 +=1if number == input_number: print("you put is true")else: print("too many times")
时间: 2024-12-16 14:35:27