I've just started learning Python and I try to run a program that is written, more or less, in the book i'm using right now (Automate the boring stuff with Python). This is the code
name='' age='' print ('what is your name?') name==input() if name=='Alice': print ('hi alice') else: print ('hello stranger, what is your age?') age==input() if age <= 18: print ('come right in') else: print ('you cannot enter')The code in the book is this:
if name == 'Alice': print('Hi, Alice.') elif age < 12: print('You are not Alice, kiddo.') elif age > 2000: print('Unlike you, Alice is not an undead, immortal vampire.') elif age > 100: print('You are not Alice, grannie.')I know he's using the elif function, but I tried to run this as well and I get the same error. How should I write so that i don't get that error? I tried with int function in front of age input and it doesn't work.