+ 1
Python question, in python3 this two symbols i don't understand (<= , >= ) please give me examples and explain also.
<= , >=
3 Réponses
+ 3
<= means ‘less or equal‘
>= means ‘greater or equal’
a=7
if a <= 10 # result True
so all values up to and including 10 give True.
a=13
if a <= 10 # result False
+ 1
Let me give you some equivalents for them:
x<=y means: x<y or x==y
x>=y means: x>y or x==y
0
If you understand < and >, then it should not be hard to understand <= and >=.
Their only difference is that <= and >= returns True, when compared values are equal, unlike < and >.