Skip to contentSkip to navigation
MODULE 01 · LESSON 01

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!

WHAT YOU WILL LEARN
What Python is

A readable, free language

Your first line

print() and a live runner

Think like a computer

Exact steps, in order

Real-world uses

And when to pick another tool

ESTIMATED TIME
15 minutes
Self-paced, play as you read
DIFFICULTY
Beginner Friendly
Zero coding needed
KNOWLEDGE CHECK
4 questions
Instant feedback, no marks lost

Python's Golden Rule: “Simple is better than complex. Readability counts.” — Code should read like plain English.

Foundations

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.

First script

Your first line of Python

Here is a complete Python program. Click each part to see what it does:

The command (a function)Built-in Command

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.

100% In-Browser · Fast & Safe
Quick tip: words need quotes. Without them, Python looks for a stored value with that name and reports an error if it cannot find one.

The universal first step in programming: tell Python to display a friendly message on your screen.

Hello World
print("Hello, World!")
print("Welcome to your coding journey with Python!")
Interactive puzzle

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

Rule: Pi starts at the top left, facing right. Pi turns on the spot, and walking into a wall stops the program.
Pi at (0, 0)Target at (4, 0)
Step 1: Add Instructions
Your Program (0/12 steps):
Click commands above to build instructions...
Creative coding

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.

Drawing line by line
Python Code: Square
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!

Direct Comparison

Why Python feels easier

Here is the same job, printing a greeting, in Python and in other languages. Pick a tab to compare.

Python 31 Clean Line
print("Hello, World!")

Easy to read, with almost nothing to memorize before you see a result.

Java5 Lines of Ceremony
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.

Origins

A Short History of Python

From a holiday coding project to one of the most popular programming languages:

#1Late 1980s

Winter Project

Guido van Rossum creates Python as a holiday coding project in Amsterdam, focusing on human readability.

#21991

First Release

Python 0.9.0 is shared with the world, featuring functions, exception handling, and classes.

#32000

Python 2.0

Added shortcuts for building lists and automatic memory cleanup, and the community kept growing.

#42008

Python 3.0

A major modernization that cleaned up older inconsistencies and made text handling simpler.

#52020

Python 2 Sunset

Python 2 reaches the end of its support.

#6TodayNow

Everywhere

One of the most popular languages for AI, data science, web services, automation, and first-time programmers.

In the real world

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.

Engineering Trade-Offs

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.

→ Use C++ or Rust

Mobile Apps (iOS/Android)

Phones need apps built with their own tools.

→ Use Swift or Kotlin

Tiny Microchips

Python needs more memory than a tiny chip has.

→ Use C or MicroPython

Safety Systems

Code must never pause, even for a split second.

→ Use C or Ada
Fun facts

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.

Knowledge check

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...

0 of 4 answered
Common doubts

Beginner Myths, Busted

Do not let these widespread misconceptions hold you back:

Myth

"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.

Myth

"Coding is for experts."

Every expert once printed their first line. You are at the same starting point.

Myth

"Errors mean I'm bad at this."

Errors are normal. They are clues, and programmers read them every day.

Myth

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 takeaways

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() and dir() let you inspect any function right inside the terminal.
Study tips (optional)Tips
You do not need to remember everything today. Every expert started with print("Hello, World!"). Run code, see what happens, and try changes. That teaches you more than reading alone.
Type and Run Code

Try typing code yourself instead of copying it. You will get used to quotes and brackets much faster.

Read Error Messages

An error is a clue, not a failure. Read the last line of the message first. It tells you what went wrong.

Look Things Up

Not sure what a command does? Type help(print) in Python and it explains it for you.

Keep It Simple

Python's golden rule: “Readability counts.” Short, clear code is better than clever tricks.

Frequently Asked Questions

4 Questions

Do I need to install anything to start?

No. The runner on this page works in your browser. Later you can download Python for free from python.org.

Is Python hard to learn?

Python is one of the easiest first languages because it reads like plain English. You will make mistakes, and that is fine: every error message is a clue.

What can I make with Python?

Games, drawings, websites, tools that save you time, and even AI projects. You will build small versions of these in later lessons.

What is the difference between Python 2 and Python 3?

Always use Python 3. Python 2 is the old version and stopped being supported in 2020. Everything in this course uses Python 3.
Your Learning Plan

Lesson 1 Checklist

Track what you have learned today. Click each item to mark it complete:

0 / 6 Completed
Check Your Understanding

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!

The Immediate Step

Take the Lesson Quiz

Take the quick comprehension quiz on a clean, dedicated page with instant explanations. 100% beginner friendly!

Coming Up in Lesson 2

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.