关键词搜索

源码搜索 ×
×

Python学习笔记-猜数字游戏(学习语法)

发布2018-09-04浏览4188次

详情内容

程序运行截图如下:

源码如下:

  1. import random
  2. print("Let's play a funny game")
  3. num=random.randint(100,999999)
  4. temp=input("please input a number while is in my mind:")
  5. while True:
  6. if(num==int(temp)):
  7. print("you're right!")
  8. print("you're a bug in my stomach!")
  9. break
  10. elif(num>int(temp)):
  11. print("The input number is too smaller than my number!")
  12. else:
  13. print("The input number is too bigger than my number!")
  14. temp=input("please input a number once again:")
  15. pass
  16. else:
  17. print("you are winner!")
  18. print("Game over!");

 

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载