|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
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("哎呀,你是小甲鱼心里的蛔虫吗?!")
print("哼~猜中了也没有奖励!")
else:
if guess > secret:
print("哥,小了小了~~~")
else:
print("嘿,小了小了~~~")
print("游戏结束,不玩了^_^")
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
========================= RESTART: G:\python\p3_8.py =========================
不妨猜一下小甲鱼现在心里想的是哪个数字:2
Traceback (most recent call last):
File "G:\python\p3_8.py", line 10, in <module>
guess = int(temp)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'builtin_function_or_method'
>>>
|
|