+ 1

Why am I getting an error?

name = "DAPHINE" age = "30" if (name == "daphine" or name == "esther") and (age < 50 and age > 20): print ("developer")

25th Jan 2022, 12:19 PM
Daphine Nzioka
Daphine Nzioka - avatar
3 Answers
+ 4
You are comparing a string with an int in age, remove the double quotes from age and after that it will be fine! for more check out this command help(int) Enjoy Learning đŸ™‚đŸ‘đŸ»
25th Jan 2022, 12:25 PM
Abhiyantā
Abhiyantā - avatar
+ 4
Also, your if statement is broken into two lines. Make it as a single statement.
25th Jan 2022, 1:35 PM
Simba
Simba - avatar
+ 1
Thanks guys. Simba your solution worked
26th Jan 2022, 11:27 AM
Daphine Nzioka
Daphine Nzioka - avatar