0
点赞
收藏
分享

微信扫一扫

python S14-第一周

那小那小 2022-03-30 阅读 49
1、猜年龄
# Author:young

age_of_oldboy = 56

count = 0
while count <3:
guess_age = int(input("guess age:") )
if guess_age == age_of_oldboy :
print("yes, you got it. ")
break
elif guess_age > age_of_oldboy:
print("think smaller...")
else:
print("think bigger!")
count +=1
if count == 3:
countine_confirm = input("do you want to keep guessing..?")
if countine_confirm != 'n':
count =0
#else:
# print("you have tried too many times..")


举报

相关推荐

第一周

第一周编程

打卡第一周

第一周学习

第一周(二)

第一周考试

第一周作业

Python 的学习--第一周

0 条评论