Is it compulsory to give a space while assigning value or checking value of a variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is it compulsory to give a space while assigning value or checking value of a variable?

Example: a=7 and a = 7 .Are they both right? if a==7: and if a == 7: . Are they both right?

15th Feb 2020, 8:20 PM
SUBHAM KAR CHOWDHURY
SUBHAM KAR CHOWDHURY - avatar
3 Answers
+ 1
It is right eather way. It is just good practice to insert spaces. It improves redability
15th Feb 2020, 8:26 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 3
in most languages the compiler will ignore spaces and returns, so you can put as few or as many as you desire. Just be careful with readability because if your code is all jumbled up itmightbehardtoreadandedit
15th Feb 2020, 9:16 PM
Kylie
Kylie - avatar
+ 1
Nice example Kylie Scott
16th Feb 2020, 6:49 AM
JS LOVER
JS LOVER - avatar