首页 > 其他 > 详细

while循环语句

时间:2017-08-08 16:10:52      阅读:248      评论:0      收藏:0      [点我收藏+]

while循环简单的基础为两中一种为while true 循环,始终为真,不断循环,还有一种为 while 后面加如条件来控制循环条件成立才为真。

 

while count <3:#while True为永远为真,while加条件表示条件成立才为真
gusses_boy = int(input("gusses_boy:"))
if gusses_boy == 23:
print("good !!!!")
break
elif gusses_boy > 23:
print("please input smaller!!!")
else:
print("please input bigger")
count = count +1
if count == 3:
caicai = input("Do you want try again?")
if caicai != ‘n‘:
count = 0
由于程序选择内容太多,就不发结果图了!!!

while循环语句

原文:http://www.cnblogs.com/nihoutao/p/7307226.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!