Python indeed allows you to do such a thing
if integer > 3 and integer < 34
Python is also smart enough to handle:
if 3 < integer < 34:
# do your stuff
More Related Contents:
- Why am getting an "elif" syntax error showing invalid syntax in python [closed]
- python 3.2 if-else
- How to end a python program without it going to the next line of code [duplicate]
- Python Code that returns true while key is pressed down false if release?
- How to test multiple variables for equality against a single value?
- Why does python use ‘else’ after for and while loops?
- Else clause on Python while statement
- if else in a list comprehension [duplicate]
- Putting a simple if-then-else statement on one line [duplicate]
- What’s the scope of a variable initialized in an if statement?
- List comprehension with if statement
- Better to ‘try’ something and catch the exception or test if it’s possible first to avoid an exception?
- Most efficient way of making an if-elif-elif-else statement when the else is done the most?
- Styling multi-line conditions in ‘if’ statements? [closed]
- What is a None value?
- if x:, vs if x == True, vs if x is True
- Putting an if-elif-else statement on one line?
- How to check if a string contains an element from a list in Python
- How to write inline if statement for print?
- What does a semicolon do?
- Multiple conditions with if/elif statements [duplicate]
- Comparing numbers give the wrong result in Python
- How to assign a variable in an IF condition, and then return it?
- One line if-condition-assignment
- Python “if X == Y and Z” syntax
- Elif and if not working or me not understanding [duplicate]
- Pythonic way to avoid “if x: return x” statements
- Python: check if an object is a sequence
- What is the recommended way to break a long if statement? (W504 line break after binary operator)
- Creating a Python list comprehension with an if and break