1
我是新来的Python,我看其他的代码,但不知道如何从矿井中删除nonetype错误,“NoneType”错误
tutorial = input("Do you want to do the tutorial? 1 is yes and 0 is no, this will be the same for everything")
if tutorial <1:
print("That isn't valid")
if tutorial>0:
print("That isn't valid")
if tutorial == 1:
print("In battle you can use either sword, magic or items. Sword damage will be between your minimum and maximum damage, magic will be constant and can be used to heal or attack, items can be used to boost attack, restore health or armour")
我得到这个错误:
Traceback (most recent call last):
File "<string>", line 250, in run_nodebug
File "C:\Users\Bas\Desktop\Game.py", line 50, in <module>
tutorial = input("Do you want to do the tutorial? 1 is yes and 0 is no, this will be the same for everything")
TypeError: 'NoneType' object is not callable
继承人的全码:
playerhealth = 100
playerlow = 10
playerhigh = 30
playerarmour = 50
playermagic = 20
level = 0
xptonextlevel = 200
itemuse = 0
rookhealth = 100
rooklow = 10
rookhigh = 20
rookarmour = 100
medichealth = 150
mediclow = 10
medichigh = 30
medicarmour = 50
rushhealth = 20
rushlow = 10
rushhigh = 10
rusharmour = 30
drillerhealth = 30
drillerlow = 50
drillerhigh = 80
drillerarmour = 20
dragonhealth = 200
dragonlow = 150
dragonhigh = 250
dragonarmour = 150
dragonmagic = 100
dragonl = 45
godhealth = 300
godlow = 250
godhigh = 350
godarmour = 250
godmagic = 200
godl = 50
magehealth = 100
magearmour = 0
magemagic = 50
magel = 10
tutorial = input("Do you want to do the tutorial? 1 is yes and 0 is no, this will be the same for everything")
if tutorial <1:
print("That isn't valid")
if tutorial>0:
print("That isn't valid")
if tutorial == 1:
print("In battle you can use either sword, magic or items. Sword damage will be between your minimum and maximum damage, magic will be constant and can be used to heal or attack, items can be used to boost attack, restore health or armour")
se = input("Input 1 for story or 0 for endless")
你有一个称为输入的变量吗? – Sayse
这是*所有*你的代码?因为你似乎一定对你的“输入”功能做了些什么。也许你将输入分配给代码其余部分的某个地方,并且最终影响了* builtin *'input'。 – idjaw
@idjaw我只是加了它全部 – Llione