1
"""用python设计第一个游戏""" import random counts = 5 answer = random.randint(1 , 10) while counts > 0: temp = input("不妨猜一下辛赣现在在心里想的是哪个数字: ") guess = int(temp) if guess == answer: print("你是蛔虫嘛?!") print("哼,猜中了也没奖励!") break else: if guess < answer: print("小啦") else: print("大啦") counts = counts - 1 print("游戏结束,不玩啦QAQ")

浙公网安备 33010602011771号