Python入门——1
2016-02-24 18:22
495 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/wuliang1992/article/details/50732746
print('--------------l love fishc--------------')
# while i:
i=1
print("you got 3 chance to play the game")
temp=input("guess a number in fishc\'s soul:")
guess=int(temp)
while (guess !=answer) and (i<3):
if guess>answer:
print("it\'s big!")
temp=input("sorry wrong! please guess again:")
guess=int(temp)
i=i+1
else:
print("it\'s samll")
temp=input("sorry wrong! please guess again:")
guess=int(temp)
i=i+1
if guess==answer and i<=3:
print("Brove!!!")
print("but there is no gift prepared for you~~~~lalalala")
else:
print("sorry ! you have used out all the chance")
print("game over!")
在学习C语言的时候开始Python入门,结合睿思上下载的视频课程以及课后习题的网页简单学习
http://bbs.fishc.com/forum-243-1.html
import random # 导入模块答案
answer=random.randint(1,10)print('--------------l love fishc--------------')
# while i:
i=1
print("you got 3 chance to play the game")
temp=input("guess a number in fishc\'s soul:")
guess=int(temp)
while (guess !=answer) and (i<3):
if guess>answer:
print("it\'s big!")
temp=input("sorry wrong! please guess again:")
guess=int(temp)
i=i+1
else:
print("it\'s samll")
temp=input("sorry wrong! please guess again:")
guess=int(temp)
i=i+1
if guess==answer and i<=3:
print("Brove!!!")
print("but there is no gift prepared for you~~~~lalalala")
else:
print("sorry ! you have used out all the chance")
print("game over!")
相关文章推荐
- Python文件基础操作(入门1)
- python 进阶学习之5--入门练习题
- 用Python和Pygame写游戏-从入门到精通(18)
- 最新《全网最热Python3入门+进阶项目实战》
- [Python] python入门指引
- python从入门到放弃之函数篇
- Python入门学习(3)
- Python 机器学习 Scikit-learn 完全入门指南
- python 3入门之 字符串方法
- 关于 Python 入门的一些问题?
- python入门教程(20)-第三方库的安装
- [Python入门及进阶笔记]Python-魔术方法小结(方法运算符重载)
- Python入门 第一天(raw、Unicode、布尔类型、list、tuple)
- python爬虫入门----用urllib抓取整个网页
- Python从安装到入门教程——写给我家傻白甜宝宝
- Python Twisted 学习系列4(转载stulife最棒的Twisted入门教程)
- Python快速入门学习笔记(一)
- Python入门知识点 你不得不看的
- opencv+python入门学习之一 图像的基本操作
- Python开源网络爬虫或网络蜘蛛scrapy入门遇到问题