weixin_43436453
weixin_43436453
2018-12-09 12:00

新手Python入门题,不知道哪里不对,求各位帮忙

  • python
  • 语法
  • 循环

循环无法进行......

#p3_1.py
import random

secret = random.randint(1,10)

temp = input ("猜猜我现在在想哪个数字?")

guess = int(temp)

while guess != secret:
    temp = intput("猜错啦,重新输入吧")
    guess = int(temp)
    if guess > secret:
        print("大了大了")
    else:
        print("再大点试试")

if guess == secret:
    pirntf("猜对啦")

print("结束啦,不玩啦!")

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答

为你推荐