r/PythonLearning • u/TheCarFamily • 22d ago
Help Request Else statement not working
Hello, my else statement is not working- the if statement its inside is, did i mess up the indents again or is it something else?
also would a display flip work to change the image back to the other image in the else statement?
any help is nice!
26
Upvotes
View all comments
Show parent comment
1
u/Dry-Bread9131 19d ago
You're not dumb at all. We've all made the same mistake with some character or other, and struggled just as much as you with finding it visually.
What you should do, as others have suggested, is use some kind of plugin for your IDE or editor to highlight and warn about syntactic issues like these. In this case I guess it should have warned about unassigned value of an operation (for whatever the - operator does for the
pygame.imageclass.)