|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- chance=2
- import random
- secrat=random.randint(1,10)
- i=random.randint(1,6)
- print('------------------鱼c的工作室-------------')
- temp = input( '不妨猜一下小甲鱼现在的心里想的是哪个数字:(只有3次机会哦)')
- guess = int(temp)
- while guess != secrat and chance>0:
- if guess>=secrat:
- print('不对哦,too big')
- else:
- print('不对哦,too small')
- print('(你还有2次机会)')
- while guess != secrat and chance>0:
- temp=input("请再输入:")
- guess = int(temp)
- if guess > secrat:
- print('不对哦,too big')
- if guess < secrat:
- print('不对哦,too small')
- chance = chance -1
- print("(你还有", chance ,sep='', end='次机会)')
- if guess != secrat:
- print('你错了哦,答案是', secrat , sep='',end='哦,哈哈,没想到吧!')
- if secrat == guess:
- print('什么,你是我心中的蛔虫吗?')
- print('哼,猜对了也没奖励')
- print('不玩啦^-^')
复制代码
运行时胜利了都还要现还剩多少次机会,而且玩完3次后也要现,这个怎么消除啊?(由于级别不够,不能发图,请见谅) |
|