-5

thats the general idea of what i'm doing but i end up with this

print("How old are you?")
age = sys.stdin.readline()

time.sleep(2) #delay for 2 seconds

if age> 15: #if the age entered it oer 15 then
    print("Welcome to Narnia, please follow me.")

else :
    print("Please go home.")

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

DYZ
  • 55,249
  • 10
  • 64
  • 93

1 Answers1

0

you need to convert the age to an integer use

age = int(sys.stdin.readline())

that way the line you read from the input will be saved as an integer and will be of the right type to be compared to the integer 15

DYZ
  • 55,249
  • 10
  • 64
  • 93