-3
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'

1 Answers1

-1

Change the first line to:

n = int(input("What is your number"))

In Python 3, input always returns a string.

Tom Karzes
  • 22,815
  • 2
  • 22
  • 41