Help this newbie please! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help this newbie please!

I tried to change the 9th line like if y==“No” or “no” : But it made all the following lines invalid for some reason. Could you explain what was wrong with this? https://code.sololearn.com/c736R3djX4p3/?ref=app

16th Jun 2019, 2:50 AM
CH Ahn
CH Ahn - avatar
3 Answers
+ 4
hi, you can do several things to get this code run properly. if y == ‘No’ or y == ‘no’ this would cover only 2 different spellings but not ‘NO’. So an other approach is recommended: if upper(y) == ‘NO’ this covers all variations of spelling.
16th Jun 2019, 5:38 AM
Lothar
Lothar - avatar
+ 1
Thank you! problem solved!
16th Jun 2019, 6:37 AM
CH Ahn
CH Ahn - avatar