Post History
Combine conditionals Python has its fair share of comparison operators and can actually be used in a single conditional. For example: x == 2 and y == 2 can be: x==y==2 Used on Make $2 + 2 ...
Answer
#2: Post edited
- # Combine conditionals
- Python has its fair share of comparison operators and can actually be used in a single conditional. For example:
- ```
- x == 2 and y == 2
- ```
- can be:
- ```
- x==y==2
- ```
<sub>Used on [**Make $2 + 2 = 5$**](https://codegolf.codidact.com/posts/283770/283779#answer-283779).</sub>
- # Combine conditionals
- Python has its fair share of comparison operators and can actually be used in a single conditional. For example:
- ```
- x == 2 and y == 2
- ```
- can be:
- ```
- x==y==2
- ```
- <sub>Used on [**Make $2 + 2 = 5$**](https://codegolf.codidact.com/posts/283770/283779#answer-283779).</sub>
- [**@celtschk**](https://codegolf.codidact.com/users/8056) also mentions that [different operators can also enter a single conditional](https://codegolf.codidact.com/comments/thread/4409#comment-13436), as long as an order is applied.
- For example:
- ```
- a < b and b > c
- ```
- Can be rewritten as:
- ```
- a<b>c
- ```
#1: Initial revision
# Combine conditionals Python has its fair share of comparison operators and can actually be used in a single conditional. For example: ``` x == 2 and y == 2 ``` can be: ``` x==y==2 ``` <sub>Used on [**Make $2 + 2 = 5$**](https://codegolf.codidact.com/posts/283770/283779#answer-283779).</sub>