Skip to content
  • Introduction to Python · Python

Introduction to Python

LearnViaNotes @learnvianotes· 2 min read

A high-level, interpreted, dynamically typed language that favours readability — the most common language for interviews, scripting, data and AI.

Why Python?

How Python runs your code

  1. Source

    You write app.py — plain text.

  2. Compile to bytecode

    CPython parses it and compiles it to bytecode (cached as __pycache__/*.pyc).

  3. Run on the PVM

    The Python Virtual Machine executes the bytecode instruction by instruction — that is the “interpreted” part.

ImplementationWhat it is
CPythonThe reference implementation, written in C. What you get from python.org. Has the GIL.
PyPyJIT-compiled — often several times faster for long-running pure-Python code.
Jython / IronPythonPython on the JVM / .NET (rarely used today).

Your first program

Python
name = "Python"
version = 3
print(f"Hello, {name} {version}!")   # Hello, Python 3!
print(type(name), type(version))    # <class 'str'> <class 'int'>
Terminal
$ python3 --version          # check the installed version
$ python3 app.py             # run a file
$ python3                    # interactive REPL (exit with Ctrl-D)
$ python3 -m venv .venv      # create an isolated environment

Style: PEP 8 and the Zen

  • 4 spaces per indent level, never tabs.

  • snake_case for variables and functions, PascalCase for classes, UPPER_CASE for constants.

  • Lines around 79–99 characters; one statement per line.

  • Run import this to read The Zen of Python — “Readability counts.”, “Explicit is better than implicit.”

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report