lundi 5 août 2019

Is there a certain way to write If statements with two booleans in it?

I'm trying to set a sort of conditional Boolean so that if either two separate Boolean variables become true, this one becomes true (on Python).

I can get it to work by having a couple of indented if statements but that seems overly long winded.

end = False
endDraw = False 
endWin = False
# where endWin and endDraw are two Booleans that are effected by external code    
if endDraw or endWin:
        end == True

I would have thought this would have worked fine but when I try it python displays "statement seems to have no effect" - which I see is true when I run the code and end stays the same despite one of the other Boolean variabls being true.

Aucun commentaire:

Enregistrer un commentaire