Beginner · 10 min read · Updated 2026-11
Python in ten minutes
Variables, text, decisions and loops — the core of Python, with tiny examples you can run as you read.
Python is a great first language: it reads almost like English and runs everywhere. If you have Linux or a Mac it's already installed; type python3 in a terminal. This is enough to be genuinely useful.
Values and variables
A variable is a name for a value. You don't declare a type — Python figures it out. print() shows something on the screen.
name = "Sepehr"
age = 23
print("Hello,", name)
print(name, "is", age, "years old")Making decisions
if / elif / else run different code depending on a condition. Indentation (the spaces at the start of a line) is how Python knows which lines belong together — it isn't decoration.
temp = 36
if temp < 20:
print("cold")
elif temp < 30:
print("mild")
else:
print("warm")Repeating with loops
A for loop repeats once for each item in a list. A list holds many values in order, written in square brackets.
devices = ["router", "switch", "camera"]
for d in devices:
print("checking", d)
print("done —", len(devices), "devices")Where to go next
With variables, conditions and loops you can already automate small jobs. Next, look at functions (def) to reuse code, and dictionaries to store named data. Our tools section has real Python programs you can read line by line.