0

I am learning python and practice some control flow statement, my program is:

name = 'ravi'

print ('enter your username first')
Username =input()

if name ==Username:
print ('hi '+Username)
print ('enter your age')
age = input()    
if age < 18:
print ('you are not valid Kido')
elif age > 2000:
print('Unlike you, Alice is not an undead, immortal vampire.')
elif age > 100:
print('You are not Alice, grannie.')
elif age>=18:
print ('Welcome in our portal')

Every time I run this code it conduct an error:

enter your username first
ravi
hi ravi
enter your age
18

Error is:

Traceback (most recent call last):
  File "C:\Users\Ravi\AppData\Local\Programs\Python\Python36\NEWpASSWORD.py", line 11, in <module>
    if age < 18:
TypeError: '<' not supported between instances of 'str' and 'int'
martineau
  • 119,623
  • 25
  • 170
  • 301

0 Answers0