|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import random
secret = random,randint(1,10)
temp = input("请输入小甲鱼心里想的数字;")
guess = int(temp)
while guess != secret:
temp = input("再猜一次:")
guess = int(temp)
if guess == secret:
print("你是小甲鱼心里的蛔虫!")
else:
if guess < secret:
print("小了小了")
else:
print("大了大了")
print("游戏结束!")
运行后显示Traceback (most recent call last):
File "D:/小甲鱼练习/yunxing.py", line 3, in <module>
secret = random,randint(1,10)
NameError: name 'randint' is not defined 说我未定义randint 怎么回事啊 大神们 |
|