设为首页收藏本站

Crossin的编程教室

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

【Python 第8课】while

[复制链接]

1

主题

0

好友

49

积分

新手上路

Rank: 1

楼主
发表于 2014-6-29 23:04:42 |显示全部楼层
  1. num=10
  2. while True:
  3.     print "Guess what I think?"
  4.     answer=input()

  5.     if answer<num:
  6.         print"too small!"


  7.     if answer>num:
  8.         print"too big!"

  9.     if answer==num:
  10.         print"excellent,you are right!"

复制代码
回复

使用道具 举报

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

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

GMT+8, 2024-5-7 03:27 , Processed in 0.017160 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部