Add 100 字符极简小游戏 - 猜数字

This commit is contained in:
traetest
2026-04-13 02:30:44 +08:00
parent ee943c5bd2
commit 73aec30c02
+5
View File
@@ -0,0 +1,5 @@
"""100 字符小游戏 - 猜数字"""
import random
n=random.randint(1,100);print("猜 1-100 的数字")
while True:
g=int(input("猜:"));print("大了!"if g>n else "小了!"if g<n else "对了!");exec("break"if g==n else"")