#PowerTreadFunction
def askPowerTread():
choice = none
while choice not in ['A','B','C']:
print("Invalid choice.")
choice = input("""Your Power Treads offer the following configurations which each give distinct bonuses, choose now:\n
a) DAMAGE\nb) DEFENSE\nc) ARMOR CLASS\n""")
You assign choice to none
(I think you meant None
) and then enter the loop without changing it.
choice = input(...)
is outside the while loop so it will never execute. Try:
def askPowerTread():
while True:
choice = input(...)
if choice in [...]:
break
else:
print('{choice} is an invalid choice'.format(choice=choice))
To demonstrate the difference between none
and None
:
>>> type(none)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
type(none)
NameError: name 'none' is not defined
>>> type(None)
<class 'NoneType'>
>>>