python/2024-6-23-1.py

17 lines
553 B
Python
Raw Permalink Normal View History

import random
secret_number = random.randint(1, 100)
attempts = 0
while True:
guess = int(input("猜猜看数字是多少1-100之间"))
attempts += 1
if guess == secret_number:
print("你居然猜对了!你猜了", attempts, "次,真菜!像只小菜一样!不是有啥实力啊!!!")
break
elif guess < secret_number:
print("小了,太菜了!像只小菜一样!有啥实力啊!!!")
else:
print("大了,太菜了!像只小菜一样!有啥实力啊!!!")