Adit Magotra
Adit Magotra

Reputation: 39

Why is my OR operator not working in python?

while scr_1 <= 4 or scr_2 <= 4 :#scr stands for score

The thing happening here is that my while loop ends only when BOTH scores have reached 5! I want it to end when only one of the above reaches 5! Please help me.

Upvotes: 0

Views: 274

Answers (1)

Andy Park
Andy Park

Reputation: 11

turn your 'or' to an 'and'

the reason for this is because you want the loop to only continue if both scr_1 and scr_2 is less than or equal to 4.

Upvotes: 1

Related Questions