The difference between = and == | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

The difference between = and ==

Hmmm.... I learned that == make the output true or false but what is the difference between the usage of = and ==?

8th Nov 2017, 12:14 PM
Jinsu
4 Answers
+ 25
= is the assignment operator while == is conditional x=5 will assign the value of 5 to x x==5 will check whether x has a value of 5 and will give True or False
8th Nov 2017, 12:23 PM
Frost
Frost - avatar
+ 4
Thanks
8th Nov 2017, 12:35 PM
Jinsu
+ 3
Example: you = "this" That is for assigning things. A boolean is the == Determines something equals another thing.
8th Nov 2017, 7:05 PM
Hyrum Harris
Hyrum Harris - avatar
+ 2
thanks
9th Nov 2017, 12:01 PM
gideon