Skip to content

Chapter 1 of 7

Introduction to Python

Python is a high-level, interpreted programming language renowned for its readability and simplicity. Created by Guido van Rossum with the first version released in 1991, Python was named after the British comedy series Monty Python. The language supports multiple programming paradigms, including procedural, object-oriented, and functional programming, making it versatile for many kinds of projects.

Among Python's key features are dynamic typing, automatic memory management, an extensive standard library, and cross-platform compatibility. The language emphasizes code readability through significant whitespace, meaning indentation is part of the syntax itself rather than just a stylistic choice. This design encourages developers to write clean, well-structured code.

To run a Python script, save your code in a file with the .py extension and execute python filename.py in the terminal. If Python 2 is also installed, you may need to use python3 instead. For interactive experimentation, Python provides a REPL, which stands for Read-Eval-Print Loop. It can be launched by typing python in the terminal, where it reads each line of input, evaluates it, prints the result, and waits for the next line, making it an excellent tool for testing small snippets of code.

All chapters
  1. 1Introduction to Python
  2. 2Variables, Types, and Operators
  3. 3Control Flow
  4. 4Functions
  5. 5Data Structures
  6. 6Object-Oriented Programming
  7. 7Modules, Exceptions, and Advanced Features

Drill it

Reading is not remembering. These come from the Python Programming deck:

Q

What is Python?

Python is a high-level, interpreted programming language known for its readability and simplicity. It supports multiple paradigms including procedural, object-o...

Q

Who created Python and when?

Guido van Rossum created Python, with the first version released in 1991. It was named after the British comedy series Monty Python.

Q

What are the key features of Python?

Python features dynamic typing, automatic memory management, extensive standard library, and cross-platform compatibility. It emphasizes code readability with s...

Q

How do you run a Python script from the command line?

Save the code in a file with .py extension, then run python filename.py in the terminal. Use python3 if Python 2 is also installed.