n = input("What is your number")
if n > 0:
print("It's Bigger Than 0")
else:
print("It's smaller than 0")
why does this give an error TypeError: '>' not supported between instances of 'str' and 'int'
n = input("What is your number")
if n > 0:
print("It's Bigger Than 0")
else:
print("It's smaller than 0")
why does this give an error TypeError: '>' not supported between instances of 'str' and 'int'
Change the first line to:
n = int(input("What is your number"))
In Python 3, input
always returns a string.