|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import random
secret = random,randint(1,10)
print('---------first game----------')
temp = input("猜猜我心里想的什么数字: ")
guess = int(temp)
while guess != secret:
temp = input("哎呀,猜错了!再猜一次吧: ")
guess = int(temp)
if guess == secret:
print("woc,猜对了!!!")
print("哼,猜中了也没有奖励")
else:
if guess > secret:
print("哥们,猜大了")
else:
print("呕吼,猜小了")
print("猜对了,真牛逼,游戏结束了,下次再玩吧~~~")
改了好长时间,,,,,,
- import random
- secret = random.randint(1,10) # 修改
- print('---------first game----------')
- temp = input("猜猜我心里想的什么数字: ")
- guess = int(temp)
- while guess != secret:
- temp = input("哎呀,猜错了!再猜一次吧: ")
- guess = int(temp)
- if guess == secret:
- print("woc,猜对了!!!")
- print("哼,猜中了也没有奖励")
- else:
- if guess > secret:
- print("哥们,猜大了")
- else:
- print("呕吼,猜小了")
- print("猜对了,真牛逼,游戏结束了,下次再玩吧~~~")
复制代码
|
|