我的一个python程序
import random
print("----------------这是我的第一个pyhon代码-------------")
temp=random.randint(0,10)
A_temp=int()
while 1:
A_temp=int(input("please input a random number between 0 to 10:"))
if A_temp<0 or A_temp>10:
print("please input a correct number between 0 to 10")
A_temp=int(input("please input a random number between 0 to 10:"))
else:
if A_temp==temp:
print("Congratulations!\nYou guess the true number.")
break
else:
if A_temp>temp:
print("Your number is bigger than the answer.")
else:
print("Your number is smaller than the answer.")
print("Game is Over!")
#注意每个字段需要缩进来区分每一段函数的结束