The Python Language 3
Python uses indentation to define code blocks, replacing curly braces common in C-style languages. It supports conditional execution with if / else constructs and iterates using for loops, utilizing the `in` keyword. Python allows list comprehensions for concise list creation and employs the `def` keyword for function definitions without requiring type declarations. Exception handling is facilitated with try / except constructs, promoting the use of specific exceptions like NameError or TypeError for clarity.
We'll cover the following...
Code blocks
In C-style languages, code blocks are indicated by curly braces {...}. In Python, we instead use a colon to introduce a code block, and all code inside that block must be indented consistently with at least one whitespace character.
Conditional execution
Like most languages, Python uses if / else constructs for conditional branching. Here, we branch using the Python boolean type, which can have values True or False ...