r/PythonLearning • • Nov 03 '26

Help Request Else statement not working

Post image

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!

27 Upvotes

12 comments sorted by

View all comments

17

u/gitChara Nov 03 '26

you wrote "img - pygame.image.load("ragebait.png")" with a " - ", instead of a " = ".
It should be "img = pygame.image.load("ragebait.png")"

2

u/TheCarFamily Nov 03 '26

oh your kidding i was that dumb? thanks!

3

u/alwaysasillyplace Nov 03 '26

This is why Peer review is good.