设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
楼主: iamocean
打印 上一主题 下一主题

【Python 第8课】while

[复制链接]

0

主题

0

好友

10

积分

新手上路

Rank: 1

楼主
发表于 2015-8-13 21:27:29 |显示全部楼层
先生问一下,bingo=True,这一行有什么作用呢
num = 18
print'Guess what i think'
a=False

while a==False:
    answer=input()

    if answer<num:
        print'too small!'

    if answer>num:
        print'too big!'

    if answer==num:
        print'you re right!'

我这样写,运行后,感觉和加没加那一行代码没什么区别
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-5-6 23:27 , Processed in 0.017617 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部