(Aug-11-2018, 05:40 PM)Loom Wrote: I tried with int function in front of age input and it doesn't work.that is exactly what you should do - convert age input (which comes as str) to int. It didn't work because you use comparison
==
, not assignment =
.age = int(input())same for the name
name = input()
name = input('what is your name? ') if name == 'Alice': print ('hi alice') else: print ('hi stranger') age = int(input('what is your age? ')) if age <= 18: print ('come right in') else: print ('you cannot enter')
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs