Why can't we use '=' operator in these statements ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why can't we use '=' operator in these statements ?

When I tried that, it gave me a syntax error

28th Mar 2020, 4:02 AM
Ahsen Mirza
Ahsen Mirza - avatar
1 Answer
+ 1
hi, what language do you use (python, JS...) ? basic syntax is usually : if (... some condition ...) {...code to execute if True...} ; in condition you can use something like : x==1 (comparaison operator) it's better than : x=1 (assignation operator who will always true or always false)
28th Mar 2020, 4:47 AM
Oneill~Онеилл~奥尼尔~ओनील~اونیل~*‎
Oneill~Онеилл~奥尼尔~ओनील~اونیل~*‎ - avatar