I was 30 min testing this but still dont work, any ideas? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I was 30 min testing this but still dont work, any ideas?

This code is supposed to output different texts(:D,D: or ?) depending on the input, but it only output :D. Why is this happening? https://code.sololearn.com/cjX15Ie9i999/?ref=app

16th Apr 2017, 9:18 AM
Racotersito
Racotersito - avatar
2 Answers
+ 5
if a == "yes" or "Yes" is not correct. You have to test if a== "yes" or a == "Yes". Yours evaluates to false or true (as a non-empty string counts as true) so it's true.
16th Apr 2017, 9:22 AM
merkrafter
+ 15
To make it more simple, you could say a = a.lower() which will convert all the characters to lowercase. Just make sure your if statement says if a == "yes".
16th Apr 2017, 10:26 AM
Gami
Gami - avatar