首页 > 代码库 > Python的Whiel循环和if流程判断
Python的Whiel循环和if流程判断
_age = 27
count = 0
while count < 3:
age = input("what is you age? ")
if age == _age:
print "ni cai de {yourage} is sussccess" .format(yourage=age)
break
elif age < _age:
print "ni cai de {yourage} nianlin xiao yu age" .format(yourage=age)
else:
print "ni cai de {yourage} nianlin da yu age" .format(yourage=age)
count += 1
#if count ==3:
#countine_confirm = raw_input("do you want to keep guessing..? ")
#if countine_confirm != ‘n‘:
#count=0
else:
print ‘all count yong wan le‘
本文出自 “YHT的运维笔记” 博客,请务必保留此出处http://yht1990.blog.51cto.com/9014030/1940942
Python的Whiel循环和if流程判断
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。