Are spaces optional? That is, we can just type x+1 instead of x + 1. Also, can I declare an array [1,2,3] instead of [1, 2, 3]? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Are spaces optional? That is, we can just type x+1 instead of x + 1. Also, can I declare an array [1,2,3] instead of [1, 2, 3]?

Wow, I almost exceeded the word limit. Anyway, give me an answer.

31st May 2017, 2:56 PM
mirapo37
1 Answer
+ 3
Depends on conventions, but generally they are optional. For example, Python accepts all, but the convention is to make spaces between variables, assignments and values (x = 6) with an exception of method named parameters do_magic(x=True) But all will work whether you write spaces or not. A question of readability only.
31st May 2017, 3:25 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar