Learn Python
>>> getting_started.intro

Introduction to Python

#concept

Python is a high-level, general-purpose programming language created by Guido van Rossum and first released in 1991. It was designed around one central idea: code should be easy to read and easy to write. Where many older languages wrap every block in braces and semicolons, Python uses indentation itself to mark where a block starts and ends, so the visual shape of the code matches its logical structure.

Python is interpreted rather than compiled ahead of time, and it's dynamically typed — you never declare a variable's type up front. It also supports several ways of organizing a program in the same codebase: procedural (plain top-to-bottom instructions), object-oriented (classes and objects), and functional (functions treated as values). Combined with a large standard library and an enormous third-party ecosystem, this flexibility is why Python shows up everywhere from a first programming class to production systems at companies like Google, Netflix and Instagram.

#how it works
1

Write the source code

You write instructions in a plain-text file with a .py extension, using Python's own syntax rules. There's no separate declaration file or build script to set up first.

2

The interpreter reads and checks it

When you run the file, the Python interpreter reads it top to bottom and checks that the syntax is valid before anything actually executes.

3

Translation to bytecode

Python automatically translates your source code into a lower-level instruction set called bytecode. This is invisible to you, and for imported modules it's often cached in a __pycache__ folder so the same file isn't recompiled on every run.

4

Execution on the Python Virtual Machine

The bytecode is executed instruction by instruction by the Python Virtual Machine (PVM) — the engine that actually carries out your program's logic.

5

Immediate output

Because there's no separate compile-then-run step like in C or Java, results appear as soon as execution reaches a print statement, and the whole program runs with a single command.

#example
# app.py
name = "Ada" # Python infers the type from the value — no declaration needed
age = 28
print(f"Hi, I'm {name} and I'm {age}.")
 
age = "twenty-eight" # names are labels, not fixed-type boxes, so this is legal
print(f"Now age holds: {age}")
Output
Hi, I'm Ada and I'm 28.
Now age holds: twenty-eight
1Line 2 creates the variable name and binds it to the string "Ada" — Python determines the type automatically from the value on the right.
2Line 3 does the same for age, binding it to the integer 28.
3Line 4 builds an f-string, substituting {name} and {age} with their current values at the moment print runs.
4Line 6 rebinds age to a string. That's legal because a Python variable is just a name pointing at an object in memory, not a fixed-type storage slot — the same name can point at a different type later.
5Line 7 prints the new value of age, confirming the rebind took effect immediately.
#use cases
Web back ends and APIs — Django, Flask, FastAPI
Data analysis and visualization — pandas, NumPy, Matplotlib
Machine learning and AI research — PyTorch, TensorFlow, scikit-learn
Automating repetitive tasks and scripting
Scientific and numerical computing
Teaching programming fundamentals to beginners
Rapid prototyping, since there is very little boilerplate to write

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Classic DSA interview booksThe reference books interviewers themselves learned from — great next to the visualizers.See the books

Practice what you learned

Re-implement each visualized algorithm in Python yourself — building beats watching.