我是靠谱客的博主 舒服金针菇,这篇文章主要介绍for循环及用for循环写猜年龄游戏,现在分享给大家,希望可以做个参考。

for循环:

for i in
range(0,10,2):
print("loop",i)


for循环写猜年龄:

age_of_XueKe=18

for i in range(3):
age = int(input("age:"))
if age == age_of_XueKe:
print("Yes,you got it!")
break
elif age >age_of_XueKe:
print("Think smaller!")
else:
print("Think bigger!")
else:
print("You have tried too many times...")

转载于:https://www.cnblogs.com/shmilymima/p/9265590.html

最后

以上就是舒服金针菇最近收集整理的关于for循环及用for循环写猜年龄游戏的全部内容,更多相关for循环及用for循环写猜年龄游戏内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(124)

评论列表共有 0 条评论

立即
投稿
返回
顶部