print("游戏结束,不玩啦^_^")
运行:
改进后:
import random
secret = random.randint(1,10)
temp = input("不妨猜一下badao现在心里想的是哪个数字:")
guess = int(temp)
while guess != secret:
temp = input("哎呀,猜错了,请重新输入吧:")
guess = int(temp)
if guess == secret:
print("哎呀,你是badao心里的蛔虫吗?!")
print("哼~猜中了也没有奖励!")
else:
if guess > secret:
print("哥,大了大了~~~")
else:
print("嘿,小了小了~~~")
print("游戏结束,不玩啦^_^")