Less than or equal to operator #
The less than or equal to operator in Python is denoted by <= It is used to compare two values and checks whether the left value is less than or equal to the right value. If the condition is true, it returns True, otherwise, it returns False.
Sometimes, the less than or equal to operator shows up as <= or <=, depending on the code editor you are using.
For example:
print(5 <= 3) # False
print(3 <= 5) # True
print(5 <= 5) # True
Exercise #
Create a variable result to have a value True by using less than or equal to operator <=.
Tests #
- Variable
resultisTrue - Use less than or equal to operator
<=
Getting Started with Python
Data Types
Python Functions
Statements in Python
Basic Debugging in Python
Basic Algorithm
Object-Oriented Programming
Error Handling
Intermediate Algorithm
Python Modules