Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • This isn't exactly a duplicate of the marked question as operator does not expose functions for and or or. In a pinch bitwise operators could be used, but that would probably justify an answer. Commented Apr 10, 2020 at 0:59
  • 1
    See: stackoverflow.com/questions/7894653/… Commented Apr 10, 2020 at 1:00
  • 2
    1 or 3 == 4 probably isn't what you want anyway, but 1 == 4 or 3 == 4. Commented Apr 10, 2020 at 1:04
  • In that case, you probably want to use any([1 == 4, 3==4]) or all([1==4, 3==4]), as desired. Commented Apr 10, 2020 at 1:05
  • (And you can assign the functions any and all to a variable.) Commented Apr 10, 2020 at 1:13