Commit a2c9a854 by BellCodeEditor

save project

parent 807c483c
Showing with 8 additions and 9 deletions
import random
n=random.randint(1,100)
a=int(input("请输入数字(1——100)"))
while True:
if a>100 or a<1:
while True: # 判断部分
if a>100 or a<1: # 数字是否符合标准
a=int(input("请输入1——100内的数字"))
else:
if n==a:
else: # 判断大小
if n==a: # 猜对
break
elif n>a:
elif n>a: #猜小
a=int(input("猜小了,请再次输入"))
else:
else: #猜大
a=int(input("猜大了,请再次输入"))
print("猜对了")
\ No newline at end of file
print("猜对了")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment