python3 猜数字游戏
2016-10-02 11:38
281 查看
x=10 #the number you set to gess i=1 n=6 while(i<=6): print("@_@:") print(n) print(" times left") y = input("please input the number you guess:") y = int(y) if(y == x): print("@_@:") print("you win") break elif(y > x): print("@_@:") print("the number you guess is a little bigger") elif(y < x): print("@_@:") print("the number you guess is a little less") i = i + 1 n = n - 1 else: print("@_@:") print("times use up,you lose")
微信赞赏
相关文章推荐
- C++ Boost 之Python(生成一个扩展模块)
- Python指南--数据结构
- Python指南--数据结构
- 搭建Python的集成开发环境WingIDE
- Python指南--深入流程控制
- Python指南--深入流程控制
- 用Python实现数据库编程
- Python指南--开胃菜
- Python指南--开胃菜
- Python指南--初步认识Python
- Python指南--初步认识Python
- Python指南--前言
- Python指南--使用Python解释器
- Python指南--使用Python解释器
- Python指南--前言
- python库lxml在linux和WIN系统下的安装
- C++ Boost 之Python(一个简单的例子)
- C++ Boost 之Python(继承)
- C++ Boost 之Python(大纲)