What the difference between : | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

What the difference between :

= and == , <= and < and what is the means of while

14th Jun 2021, 4:19 PM
Ranjana Sharma
3 Answers
+ 1
=for setting value and the other signs are used for comparing. The operators are used to compare with one value to another if the condition becomes true it returns true otherwise false. == means if it's equal or not >=means greater than or equal > means greater than < means less than <= means less than or equal != means not equal while is a loop that is used to execute an amount of code for a certain time until the condition inside while loops are true.Read the comments of the lesson the comments are very useful.Also please next time include the language tag.
14th Jun 2021, 4:38 PM
The future is now thanks to science
The future is now thanks to science - avatar
0
Hi, Ranjana Sharma! In Python, = is used when assigning a value to a variable: variable = 3 == is used to compare to values: if variable1 == 3: print("Variable1 is equal to 3") < means smaller than: 3<5 -- True 3<3 -- False <= means smaller or equal to: 3<=4 -- True 3<=3 -- True while loop repeats an action if a condition is true, this code for example, will add 1 to variable until variable is equal or bigger than 5: while variable < 5: variable = variable + 1 I hope that was useful, Ranjana Sharma.
14th Jun 2021, 4:34 PM
HNL
HNL - avatar
0
Thanku so much
23rd Jun 2021, 12:16 PM
Ranjana Sharma