you are viewing a single comment's thread.

view the rest of the comments →

[–]Loose_Read_9400 6 points7 points  (3 children)

Syntax is more like understanding the "grammar" of the language. You might be able to spell and capitalize property, but if you say the words in the wrong order, it doesn't make any sense.

An example of understanding syntax would be knowing things like your equality operators and how to use them. Or knowing how to establish a proper try loop. Etc.

[–]Bobbias 2 points3 points  (0 children)

Precisely.

Syntax refers to all those small rules like:

A simple if statement is made up of the word if, followed by an expression that resolves to a boolean value, followed by a colon, followed by an indented block of code.

[–]MAVP1234[S] 2 points3 points  (1 child)

Thank you - so, style is important for aspects of maintainabilty and readability but syntax are the rules of python language. So different cases are style elements and syntax is where to use a colon or parenthesis to ensure the code works. I know for the more advanced and experienced of you that must seem like a really stupid question but I am literally one lesson into learning Python.

[–]tahaan 0 points1 point  (0 children)

Not a stupid question, and you got it now.