+ 2

what is the different between = and ==

9th Jul 2017, 3:41 PM
Youssuf Abramo
Youssuf Abramo - avatar
5 Answers
+ 9
= assigns a value == checks it How you'd mostly use them: var a = 15; You make the value of a 15. if(a == 15){ //code } You check if a has a certain value
9th Jul 2017, 3:44 PM
Maart
Maart - avatar
+ 9
Of course in Python it will be: a = 15 if a == 15: code_here respectively :)
9th Jul 2017, 3:53 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 4
@Kuba yeah thanks, didn't notice it was about Python 😉
9th Jul 2017, 5:28 PM
Maart
Maart - avatar
+ 1
= assignment operator == boolean equality operator
9th Jul 2017, 4:46 PM
Andrés04_ve
Andrés04_ve - avatar
0
= is used for assignement and == is used for check equality.
10th Jul 2017, 10:03 PM
Naima TRABELSI
Naima TRABELSI - avatar