Editor settings

General settings

Save settings

Learn to program with Python

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 result is True
  • Use less than or equal to operator <‏=
Output will be displayed here