Difference between “<=“ and “<“ ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Difference between “<=“ and “<“ ??

I DID A TEST WITH THOSE TWO SYMBOLS AND I GOT THE SAME RESULTS. WHY??? DO THEY BOTH HAVE THE SAME CONCEPT AND USE??

12th Oct 2019, 2:40 AM
MCPE Gaming
MCPE Gaming - avatar
7 Answers
+ 5
"a <= b" means a is less than OR equal to b "a < b" means a is less than b it can't be equal For example:- 2<=3 is true 2<=2 is also true 2<3 is true But 2<2 is not true
12th Oct 2019, 2:47 AM
Arsenic
Arsenic - avatar
0
The difference appears in the case where the compared values are equal. If a and b were equal: These would be both False: a < b a > b And these would both be True: a <= b a >= b
12th Oct 2019, 5:55 AM
Seb TheS
Seb TheS - avatar
0
Oh okay thx so much it helped but i have a question. So does that mean for example: >>> 1 <= 2 True >>> 1 < 2 True >>> 1 <= 2 True >>> 2 < 1 False
12th Oct 2019, 4:03 PM
MCPE Gaming
MCPE Gaming - avatar
0
MCPE Gaming Those 4 comparisons don't describe the difference between <= and < , but they are not wrong.
12th Oct 2019, 4:39 PM
Seb TheS
Seb TheS - avatar
0
oh oops but so its correct?
12th Oct 2019, 4:40 PM
MCPE Gaming
MCPE Gaming - avatar
0
MCPE Gaming They are all correct.
12th Oct 2019, 4:41 PM
Seb TheS
Seb TheS - avatar
0
okay thx
12th Oct 2019, 4:41 PM
MCPE Gaming
MCPE Gaming - avatar