A short, friendly starting point
Before you write a single line, it helps to know how Python thinks. This page walks through the basics: what the language is for, how it wants you to name things, and how it stores data.
Four ideas, in order. Each builds a little on the last.
Python is a high-level programming language, which means it reads much closer to plain English than to the raw instructions a computer executes. That readability is a big part of why it's often a first language.
It's also general-purpose. The same language builds web applications, cleans and reshapes data, and trains machine learning models — you're not learning a niche tool, you're learning something used across most corners of software.
Python doesn't force much on you, but variable names follow a few habits worth learning early.
name, total_score — rather than Name or NAME.
age or _temp.
number1 — but a name can't start with one.
firstName and firstname are two different variables to Python, even though a person might read them as the same word.
Most languages mark where a block of code begins and ends with braces. Python uses whitespace instead — the indentation itself is the structure, not just a style choice.
JavaScript
function myFunction() {
// code lives inside the braces
// ...
}
Python
def my_function(): # code lives inside the indent # ...
A variable is a container for a value you want to store and use later. Unlike languages that ask you to declare a type up front — this holds an integer, that holds text — Python figures the type out on its own, from whatever value you assign.
Example assignment
x = 5 # x is an integer name = "John" # name is a string price = 99.99 # price is a float is_active = True # is_active is a boolean
The = symbol
It's worth slowing down on this one, because it doesn't mean what it means in a math class. When you write:
name = "John"
not this
name equals John
this
Store the value "John" inside the variable called name.
The = sign is an instruction, not a comparison — it takes whatever is on the right and puts it into the box named on the left.
The four you'll meet constantly as a beginner:
1, 2, 3, -40
1.2, 4.6, 2.5
"test", "word"
True, False
Before a program can ask you anything, it needs a way to talk back. That's what print() is for — it lets your program display information to the user.
The simplest version
print("Hello World!")
Printing a variable
name = "Jordan"
print(name)
Printing text and a variable together
age = 15 print("My age is", age)
Separate them with a comma and print() handles the spacing for you.
student activity
Create these three variables:
name = "Your Name" age = 15 favorite_color = "Blue"
Then print all three.
Output goes one way: program to person. input() is what lets a person talk back.
name = input("What is your name? ") print("Hello", name)
The process
So what actually happens when this line runs?
name = input("What is your name? ")
The computer, in order:
nameA first small program, built from everything so far: variables, input, and output.
requirements
The program should ask for:
Then display a short introduction.
Example
name = input("What is your name? ") age = input("How old are you? ") food = input("What is your favorite food? ") game = input("What is your favorite game? ") print("My name is " + name) print("I am " + age + " years old") print("My favorite food is " + food) print("My favorite game is " + game)
A program to write on your own, using everything covered on this page so far.
program name
My Gamer Profile
The program must ask the user for:
Then display the information.
Example output
===== GAMER PROFILE ===== Name: Alex Age: 15 Favorite Game: Minecraft Platform: PC =========================