Spacing


#1

Hello,

When I am typing a variable to equal something do I want to have spaces between the variable and the equal sign?
Ex: cats = 3 or cats=3
Does it matter either way? I want to make sure I am learning everything the correct way so I don't start to form bad habits.

Thank you!

`


#2

I saw this post, and I was wondering about it earlier. I tested both, and either one worked. I also asked a family member for a second opinion (they code/program for a living) and they agreed, although they said that in general they preferred cats = 3. (with spacing)

I hope this helps you~


#3

PEP8 is the generally accepted python style guide and much of it applies to most other languages as well so go ahead and read it/use as reference


#4

Thank you! It does help!


#5

Thanks for the great suggestion! I will definitely use this as a tool!


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.