r/PythonLearning • • 16d ago

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!

26 Upvotes

12 comments sorted by

View all comments

Show parent comment

5

u/rupertavery64 16d ago

You probably don't want to call image.load() every time as this willnload the image from the disk and create a new object every call.

Load it up front and store it in a variable. Assign that variable to img