What does this symbol mean ? == | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does this symbol mean ? ==

==

16th Jun 2018, 6:23 AM
Buldingboy968 -
Buldingboy968 - - avatar
5 Answers
+ 1
when you want to assign a variable, use = but in if, elif, while, else, for loops use== to make the computer check whether the L.H.S = R.H.S
16th Jun 2018, 7:35 AM
Sahil Danayak
Sahil Danayak - avatar
+ 2
Sahil Danayak You don't need an if-alike statements or conditional loop to use ==. Example: int isEqual (int a, int b) { return (a == b); } void sillyFunc (int a, int b) { std::string answ[2]; answ[0] = "No!\n"; answ[1] = "Eeeyup.\n"; std::cout << "Are a & b equal?\n"; std::cout << answ[(a==b)]; } I'll leave arrays of function pointers to the imagination.
16th Jun 2018, 9:14 AM
non
+ 2
I am sorry but the question is about python
16th Jun 2018, 1:53 PM
Sahil Danayak
Sahil Danayak - avatar
+ 1
Gawd I wish people would specify language(s) in the title. I mean I don't read tags because they're full of trash, eg: "this" "what" "does" "mean" ... Anyway, I'm 99% sure my C++ example translates to Python. The point was to illustrate that == is an operator like + or - and not _necessarily_ to do with keywords (if, for, etcetera).
18th Jun 2018, 1:47 AM
non
0
To check value is equal or not
16th Jun 2018, 7:46 AM
Shubham Surya
Shubham Surya - avatar