Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
x = 60
if x > 100 or x < 50:
    print(x)


What I have tried:

x = 60
if x > 100 || x < 50:
    print(x)
Posted
Updated 4-Aug-17 20:08pm

1 solution

No, there isn't. "or" is Python's operator, || doesn't exist, and, because it's the same number of characters, it's not even "shorthand" :)

Or do you mean short-circuiting[^]? Python's "or" is short-circuiting.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900