Skip to content

Introduction to Python

Before writing a single line of code, a professional engineer must understand their tools. Python is not merely a collection of keywords and syntax; it is a philosophy of software design that prioritizes readability, developer productivity, and explicitness over raw execution speed.

To master Python, you must understand not just what it is, but how it thinks.


Python is a high-level, interpreted, general-purpose programming language. While those are standard technical terms, they have specific implications for how you write code.

  • Creator: Guido van Rossum
  • Inception: Late 1980s (released 1991)
  • Name Origin: Derived from “Monty Python’s Flying Circus,” reflecting a community culture that values fun and avoids over-seriousness.
  1. Interpreted (Technically Bytecode-Compiled): Python code is not directly converted to machine code for your CPU. It is compiled into Bytecode, which is then run by a Virtual Machine. This abstraction allows Python to be platform-independent.
  2. Dynamically Typed: Variable types are associated with the objects themselves, not the names. You don’t declare types; Python figures them out at runtime.
  3. Strongly Typed: Unlike JavaScript, Python will not silently try to add a string to a number (e.g., "2" + 2 is a TypeError). It requires explicit intent.
  4. Automatic Memory Management: Python uses Reference Counting and a Cycle-Detecting Garbage Collector to handle memory, freeing you from manual allocation.

Python’s design is guided by a collection of 19 aphorisms known as The Zen of Python. It serves as a pedagogical and architectural guide for writing “Pythonic” code.

You can view it anytime by typing import this in your terminal.

The Zen of Python (Excerpt)
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
  • Readability counts: Python code is read significantly more often than it is written. The mandatory indentation (whitespace) ensures the visual structure of the code matches its logical flow.
  • Explicit is better than implicit: Python avoids “magic.” For example, to use a library, you must import it. To use a class attribute, you must reference self. This clarity prevents hidden bugs.

Python has transitioned from a “scripting language” to the dominant force in modern computing.

  • The “Batteries Included” Philosophy: Python’s Standard Library is massive. Out of the box, you can handle ZIP files, parse HTML, connect to databases, and even run a web server without installing third-party tools.
  • Dominance in AI and Data Science: Because Python is “glue,” it can wrap high-performance C and Fortran libraries. This gives you the ease of Python with the mathematical speed of low-level languages (e.g., NumPy, PyTorch).
  • The Glue Language: Python excels at connecting disparate systems together—talking to a C++ database, a Java legacy system, and a modern JavaScript frontend.

What actually happens when you hit “Run”? Python follows a hybrid model.

Python translates your source code (.py) into Bytecode (stored as .pyc files in a __pycache__ folder). Bytecode is a low-level set of instructions specifically for the Python Virtual Machine (PVM).

The PVM is a giant loop that reads one bytecode instruction at a time and maps it to a sequence of machine code instructions on your CPU.

Python trades raw machine efficiency for human efficiency. It is the language of choice for rapid prototyping, complex data analysis, and scalable web backends because it allows developers to focus on solving problems rather than managing memory.

In the next chapter, we will prepare your machine to run the Python interpreter.