Python Syntax

Execute Python Syntax

Python syntax can be executed by writing directly in the Command Line.

>>> print("Hello, World!")

Hello, World!

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.

Uses indentation to indicate a block of code.

Examples:

syn

Error Examples:

syn

You have to use the same number of spaces in the same block of code; otherwise, Python will give you an error:

syn