码迷,mamicode.com
首页 > 其他好文 > 详细

05.for循环语句

时间:2016-11-04 13:41:33      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:shutdown   odi   语句   循环语句   guess   bsp   for   bin   for循环   

#!/usr/bin/env python
#coding:utf8
#Author:Felix zheng
 
age_of_felix = 32
count = 0
for i in range(3):
guess_age = int(input("guess age:"))
if guess_age == age_of_felix:
print("yes,you got it.")
break
elif guess_age < age_of_felix:
print("think smaller!")
else:
print("think bigger!")
 
count +=1
else:
print("you have tried too many times... shutdown")

05.for循环语句

标签:shutdown   odi   语句   循环语句   guess   bsp   for   bin   for循环   

原文地址:http://www.cnblogs.com/ityunv/p/6029715.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!