Introduction to Python
In about 15 minutes you will guide a robot, draw shapes, run code, and discover where Python is used. No experience needed, and mistakes are welcome!
A readable, free language
print() and a live runner
Exact steps, in order
And when to pick another tool
Python's Golden Rule: “Simple is better than complex. Readability counts.” — Code should read like plain English.
Meet Python
A programming language is a way to give a computer instructions. Python is an open-source, high-level, general-purpose programming language that reads almost like plain English. It was designed so those instructions are easy to read and write. If you can read an English sentence, you can start reading Python.
Easy to read
Python code looks like short, clear instructions. You spend your time on ideas, not on strange symbols.
Free and open source
Anyone can download Python, read how it works, and help improve it. It runs on Windows, macOS, Linux and small boards like the Raspberry Pi.
Named after comedy
The name comes from the British comedy show Monty Python's Flying Circus, not from the snake. Coding should be fun.
Technical version (optional)CPython & Bytecode
Python is a high-level, general-purpose language. The standard implementation, CPython, compiles your source code to bytecode and runs it on a virtual machine. It is dynamically typed, so types are checked while the program runs, and it manages memory for you. It also ships with a large standard library, which is why a short script can do a lot.
Your first line of Python
Here is a complete Python program. Click each part to see what it does:
print is a built-in Python command. It tells the computer: show whatever is inside my brackets on the screen. Think of it as a megaphone.
Try Your First Python Code
Pick an example, change the code if you like, then press Run. This is a small practice runner, so it understands the basics: print, maths, text, variables, lists, if and loops.
The universal first step in programming: tell Python to display a friendly message on your screen.
print("Hello, World!")
print("Welcome to your coding journey with Python!")Think Like a Computer: The Robot Game
A computer never guesses. It follows your steps exactly, in order. Build a list of moves to help Pi reach the star
Draw with Code (Python Turtle)
Python comes with a drawing tool called turtle. Imagine a pen that walks across the screen. You tell it to move forward and turn, and it draws. Press a button to see the code draw a shape.
import turtle
t = turtle.Turtle()
for i in range(4):
t.forward(120)
t.right(90)How it works: The turtle holds a virtual pen. Every forward(pixels) draws a line, and every right(degrees) or left(degrees) turns the pen!
Why Python feels easier
Here is the same job, printing a greeting, in Python and in other languages. Pick a tab to compare.
print("Hello, World!")Easy to read, with almost nothing to memorize before you see a result.
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}Java forces you to define a class, a public static method signature, string array parameters, and semicolons before printing a single word. Python gets straight to the point.
A Short History of Python
From a holiday coding project to one of the most popular programming languages:
Winter Project
Guido van Rossum creates Python as a holiday coding project in Amsterdam, focusing on human readability.
First Release
Python 0.9.0 is shared with the world, featuring functions, exception handling, and classes.
Python 2.0
Added shortcuts for building lists and automatic memory cleanup, and the community kept growing.
Python 3.0
A major modernization that cleaned up older inconsistencies and made text handling simpler.
Python 2 Sunset
Python 2 reaches the end of its support.
Everywhere
One of the most popular languages for AI, data science, web services, automation, and first-time programmers.
Where Python is used
The skills you learn here carry over to many fields.
Artificial intelligence
Tools such as TensorFlow and PyTorch are used to build and train machine learning models.
Data and science
Libraries such as NumPy and pandas help people analyse large amounts of data.
Websites
Frameworks such as Django and Flask power many websites and web services.
Automation
A short script can rename hundreds of files or tidy a spreadsheet in seconds.
Games
Pygame lets you build simple 2D games, a great first project.
Research
Scientists and engineers use Python to process data from experiments and missions.
When NOT to Use Python
No tool is perfect for everything. Here is when engineers pick another language:
3D High-End Games
Needs very fast, direct control of the graphics chip.
Mobile Apps (iOS/Android)
Phones need apps built with their own tools.
Tiny Microchips
Python needs more memory than a tiny chip has.
Safety Systems
Code must never pause, even for a split second.
Did you know?
Python hides a few surprises. When you install it on your computer, you can try these in the Python prompt.
A poem inside Python
Type import this and Python prints "The Zen of Python", a short list of ideas for writing good code.
A hidden comic
Type import antigravity and Python opens a comic from xkcd in your web browser.
Indentation counts
Python uses the spaces at the start of a line to group code, so tidy layout is part of the language.
Errors are clues
When something breaks, Python tells you the line and the kind of problem. Try the Oops! example above.
Check your instincts
Guess first, then read the explanation. A wrong guess is not a failure. It is where the learning happens.
1. What does this print?
print(2 + 3)2. What does this print?
print("Hi" * 3)3. What does this program print?
x = 4
x = x + 1
print(x)4. Python was named after...
Beginner Myths, Busted
Do not let these widespread misconceptions hold you back:
"I'm not a maths person."
Most everyday programming uses basic arithmetic (+, -, *, /) and clear, step-by-step thinking. If you can follow a recipe, you can write Python.
"Coding is for experts."
Every expert once printed their first line. You are at the same starting point.
"Errors mean I'm bad at this."
Errors are normal. They are clues, and programmers read them every day.
Can Python handle big professional tech operations?
Reality: Python orchestrates modern AI and cloud infrastructure. Computation-heavy engines (like PyTorch and databases) run in C++ under the hood, while Python provides the clean, joyful steering wheel.
Key Points & Concept Review
Review these foundational principles and core concepts before moving forward:
- Python is designed to read like plain English, keeping your code clean and easy to understand.
- First released in 1991 by Guido van Rossum; guided by 'The Zen of Python' (
import this): simple is better than complex. - Python reads your code and runs it one step at a time, from top to bottom.
- Python looks after types and memory for you, so you can focus on your idea.
- Powers modern technology worldwide—from AI (
PyTorch) and data science (Pandas) to web backends. - Error messages are friendly clues that point to the exact line, not failures to fear.
- Built-in tools like
help()anddir()let you inspect any function right inside the terminal.
Study tips (optional)Tips
print("Hello, World!"). Run code, see what happens, and try changes. That teaches you more than reading alone.Try typing code yourself instead of copying it. You will get used to quotes and brackets much faster.
An error is a clue, not a failure. Read the last line of the message first. It tells you what went wrong.
Not sure what a command does? Type help(print) in Python and it explains it for you.
Python's golden rule: “Readability counts.” Short, clear code is better than clever tricks.
Frequently Asked Questions
Do I need to install anything to start?
Do I need to install anything to start?
Is Python hard to learn?
Is Python hard to learn?
What can I make with Python?
What can I make with Python?
What is the difference between Python 2 and Python 3?
What is the difference between Python 2 and Python 3?
Lesson 1 Checklist
Track what you have learned today. Click each item to mark it complete:
Ready for Your Next Step?
As this is an introductory overview, there are no mandatory coding exercises for this lesson. Simply test your understanding with the quick quiz, then jump straight into writing your first program!
Take the Lesson Quiz
Take the quick comprehension quiz on a clean, dedicated page with instant explanations. 100% beginner friendly!
Interactive Labs Begin Next!
Hands-on coding exercises and lab challenges start in Lesson 2: “Your First Python Program” once you learn how to craft full scripts.