import random target=random. randint(1,100) ⑴ True: guess=int(input(“请输入你猜的数(1~100):")) if guess==target: print("你猜对了,数字是"+str(target)) ⑵ #注释:跳出循环 if guess>target; print("你猜的大了点!") else: print("你猜的小了点!") print("游戏结束") |
⑴ A.if B.for C. while D.range
⑵ A.True B.False C. stop D.break