Python学习

Day01

while 循环

   Feibucat = 20

count = 0
while count <3:
guess_age = int(input("guess: "))
if guess_age == Feibucat:
print("yes, you got it")
break
elif guess_age > Feibucat:
print("think smaller.")
else:
print("think bigger!")
count +=1
if count ==3:
continue_confirm = input("do you want to keep guesstion..?")
if continue_confirm != 'n':
    count =0

for循环

Feibucat = 20
count = 0
for i in range(3):
guess_age = int(input("guess: "))
if guess_age == Feibucat:
print("yes, you got it")
break
elif guess_age > Feibucat:
print("think smaller.")
else:
print("think bigger!")
count +=1
else:
print("you have tried too many times... fuck you~!")
 
posted @ 2020-08-23 12:01  起飞的鸽子  阅读(97)  评论(0)    收藏  举报