Skip to main content
Advertisement

Ch 1.1 Python Overview

Target Version: Python 3.12+ Official Docs: Python Official Documentation

Python is a high-level programming language first released in 1991 by Guido van Rossum. Today it is used across virtually every domain — AI/ML, web development, data analysis, automation, and more — and has become one of the most popular languages in the world.

1. What Is Python?

The name "Python" was not taken from a snake. Guido van Rossum was a fan of the British BBC comedy program "Monty Python's Flying Circus", so he chose the name because it was short, memorable, and fun.

  • Creator: Guido van Rossum, a Dutch programmer
  • First Release: 1991 (Python 0.9.0)
  • Current Steward: Python Software Foundation (PSF)
  • License: PSF License (open source, commercial use allowed)
# A simple example showcasing Python's philosophy
# Readable, concise, and clear code
names = ["Alice", "Bob", "Charlie"]
for name in names:
print(f"Hello, {name}!")

2. Four Key Characteristics of Python

Feature 1: Excellent Readability and Indentation Syntax

Python uses indentation instead of curly braces ({}) to delimit code blocks. The code reads almost like English prose.

# Java or C would need curly braces, but Python uses indentation for blocks
def greet(name: str) -> str:
if name:
return f"Hello, {name}!"
else:
return "Hello, stranger!"

print(greet("Python")) # Hello, Python!

Feature 2: Interpreted Language

Python is an interpreted language. Source code can be executed line by line immediately, without a compilation step.

  • Code runs immediately without a compilation phase
  • Supports interactive execution in a REPL (Read-Eval-Print Loop) environment
  • Great for rapid prototyping and experimentation

Feature 3: Multi-Paradigm Support

Python supports multiple programming paradigms.

# Procedural programming
def add(a, b):
return a + b

# Object-oriented programming
class Calculator:
def add(self, a, b):
return a + b

# Functional programming
from functools import reduce
result = reduce(lambda a, b: a + b, [1, 2, 3, 4, 5])
print(result) # 15

Feature 4: Huge Ecosystem (PyPI)

PyPI (Python Package Index) hosts over 500,000 packages. A single pip install command gives you access to almost any functionality imaginable.

3. Python 2 vs Python 3

Python 2 reached official end-of-life (EOL) on January 1, 2020. Python 3.x is now the only standard.

Python 2Python 3
printprint "hello" (statement)print("hello") (function)
Integer division5 / 2 = 25 / 2 = 2.5
Default stringASCIIUnicode (UTF-8)
range()Returns a listReturns an iterator
EOLJanuary 2020Currently supported
# Correct usage in Python 3
print("Hello, World!") # function form
result = 5 / 2 # 2.5 (true division)
integer_div = 5 // 2 # 2 (floor division)
text = "Python natively supports Unicode 🐍"
print(text)

4. Major Version Timeline

VersionRelease YearKey Features
Python 3.82019Walrus operator (:=), f-string debugging (f"{x=}")
Python 3.92020list[int] type hints directly, dictionary merge (|)
Python 3.102021match-case syntax (structural pattern matching), int | str union types
Python 3.112022Up to 60% performance improvement, improved error messages
Python 3.122023Type system improvements, f-string overhaul, @override decorator
Python 3.132024Interpreter improvements, REPL upgrade, JIT compiler (experimental)
# Python 3.10+ match-case (structural pattern matching)
def http_status(status: int) -> str:
match status:
case 200:
return "OK"
case 404:
return "Not Found"
case 500:
return "Internal Server Error"
case _:
return "Unknown"

print(http_status(404)) # Not Found

5. Six Key Application Domains

1) AI / Machine Learning (ML)

World-class AI libraries like TensorFlow, PyTorch, and scikit-learn are all Python-based.

2) Web Backend Development

Web frameworks like Django, FastAPI, and Flask power platforms such as Instagram, Pinterest, and Dropbox.

3) Data Analysis / Science

Data processing and visualization using Pandas, NumPy, Matplotlib, and Jupyter Notebook.

4) Automation / Scripting

File processing, web crawling, task automation, and test automation (Selenium, Playwright).

5) Education

The most widely adopted introductory programming language at universities and educational institutions worldwide.

6) DevOps / Infrastructure

Broadly used for infrastructure automation with Ansible, Fabric, AWS Lambda, GCP Cloud Functions, and more.

6. The Philosophy of Python — The Zen of Python

Running import this in the Python interpreter displays the 19 aphorisms of "The Zen of Python" written by Tim Peters.

import this

Key aphorisms and their meanings:

OriginalMeaning
Beautiful is better than ugly.Beautiful code is better than ugly code.
Explicit is better than implicit.Being explicit is better than being implicit.
Simple is better than complex.Simple solutions are better than complex ones.
Readability counts.Readability matters.
There should be one obvious way to do it.There should be one clear way to accomplish a task.
If the implementation is hard to explain, it's a bad idea.An implementation that is hard to explain is a bad idea.
# Code example embodying the Zen of Python spirit
# Bad example: overly clever code
result = (lambda f: (lambda x: f(lambda v: x(x)(v)))(lambda x: f(lambda v: x(x)(v))))(lambda f: lambda n: 1 if n == 0 else n * f(n-1))(5)

# Good example: clear and readable code
def factorial(n: int) -> int:
"""Calculates the factorial of n."""
if n == 0:
return 1
return n * factorial(n - 1)

print(factorial(5)) # 120

Pro Tips: The Python Community and PEP

PEP (Python Enhancement Proposal) is the official document format used to propose new features, syntax changes, and guidelines for Python.

  • PEP 8: Python code style guide (must-read!)
  • PEP 20: The Zen of Python (import this)
  • PEP 484: Introduction of type hints
  • PEP 572: Walrus operator (:=)
  • PEP 634: Structural pattern matching (match-case)
# Key points from the PEP 8 style guide
# Good examples
user_name = "alice" # snake_case for variables
MAX_RETRIES = 3 # UPPER_CASE for constants
class UserProfile: # PascalCase for class names
pass

# Bad examples
userName = "alice" # camelCase (Java style — not recommended in Python)
maxretries = 3 # lowercase without separator
class user_profile: # snake_case class name (not recommended)
pass

Ways to get involved with the community:


Now that you understand the basics of Python, the next step is to set up your development environment. The following chapters walk you through everything from installing Python to configuring a virtual environment.

Advertisement