0

TypeError: '>=' not supported between instances of 'NoneType' and 'int'

I am making a dice in python, but i keap getting an error at "if amount>=1:" statement.I have seen i am suppose to use prompt as input, but i don't understand why.Could somebody please explain me what my mistake is.Is the amount not suppose to take in number i give as input and compare it to 1? the link is my code so far. https://i.stack.imgur.com/UW7hx.png

11th Jul 2018, 1:19 PM
foksbeats
foksbeats - avatar
1 Antwort
+ 1
print() function doesnt return anything so amount gets None (the default value if a function doesnt return anything in Python). Put the input in amount variable turn it into an int then print it... amount = int(input()) print(amount)
11th Jul 2018, 1:26 PM
TurtleShell
TurtleShell - avatar