Python Basics
Python Syntax:
Execute Python Syntax
As we learned in the previous page, Python syntax can be executed by writing directly in the Command Line:
Python Indentation:
Indentation refers to the spaces at the beginning of a code line.
Where in other programming languages the indentation in code is for readability only, the indentation in Python is very important.
Python uses indentation to indicate a block of code.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0unZClcQXc_wlpBbDTzC7IZ8hTm2mhcX0F7N80GyqMjPMj4c5Gv2di-WU67JFTxSMo1FnwwEnJDQRtvATN0Pd9eMH1c3iJY25Zm5povVxI88FvL2ZK7kdT5Ai4sgWsOnsbbicbv6VGJLIuLhBrcz8LYz7gV5rDHK20VW8gLq7E_M5F07ITHteiC4/w365-h112/test1.png)
Python will give you an error if you skip the indentation
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiauTHSwzwII26KjtCzWeOqYFRLpLAnExlBNb4LdCryOWp0MdbLc9XEM8eA_UGChbDaNEwK57-gh9Tc_nbK1KJiD2FHhaFuL1RhvHCf66-A7toAe6TT6DMfxNIbryG1VluHATxDSqYJmtJRJ7oH-hxLkp__g9zKgP-w6jyjDvDirpAlFepWO52dW5np/w365-h124/t2.png)
Python Variables:
In Python, variables are created when you assign a value to it:
Python has no command for declaring a variable.
You will learn more about variables in the Python Variables chapter.
Comments:
Python has commenting capability for the purpose of in-code documentation.
Comments start with a #, and Python will render the rest of the line as a comment: