第四课的课后作业(python)
python第四课的成果(自己有亿点点改进)import random
times = 3
secret = random.randint(1,10)
print ("--------------------------数学真有趣--------------------------")
guess = 0
print("你猜我正在想什么数字?1到10。猜不出来是傻瓜",end="")
while (guess!=secret)and(times>0):
temp = input ()
guess = int (temp)
times =times -1
if guess == secret:
print("你猜对了,偷答案的家伙")
else:
if guess >secret:
print("大了大了,你个憨憨")
else:
print("小了小了,你是不是脑子进水")
print("憨憨,游戏结束了")
页:
[1]