[SOLVED] These if, elif, else statements are not working. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

[SOLVED] These if, elif, else statements are not working.

im trying to make this code so that. When i input a letter, it comes up a pixel art equivent. But but when i input any letter. it comes up with the equivent for A. any ideas? https://code.sololearn.com/cFPFjvwDsXPr/?ref=app

24th May 2018, 7:59 PM
LONGTIE👔
LONGTIE👔 - avatar
2 Answers
+ 2
The boolean conditions are the problem here. You want az == "a" or az == "A". My python is a bit hazy now, but any non zero value in a boolean statement evaluates to true, so this elif will always be satisfied. It's a mistake I remember making myself :)
24th May 2018, 8:15 PM
Dan Walker
Dan Walker - avatar
+ 2
thx it works now
24th May 2018, 8:18 PM
LONGTIE👔
LONGTIE👔 - avatar