Skip to content
BetaDE

Before you start

What is Python – and why is it worth it?

Five minutes of reading, a few clicks on “Run” – and you'll know what you're getting into.

What is Python anyway?

A computer really only understands zeros and ones. So that people can still tell it what to do, there are programming languages – a kind of translation between us and the machine. Python is one of them, and one that reads almost like English.

Press Run – this is already a complete Python program:

print("Hi! I'm your first Python program.")
print("I can do maths:", 7 * 6)

Python has been around since 1991. It was invented by the Dutch programmer Guido van Rossum. By the way, he didn’t name it after the snake but after the British comedy group Monty Python – which is why Python examples are often a bit silly.

Why Python?

  • Easy to read: Python code looks tidy. Instead of lots of brackets and symbols, indentation shows what belongs together.
  • Get started instantly: A single print("Hello") is already a finished program – many other languages need several lines of scaffolding around it.
  • Hugely popular: Python is one of the most popular programming languages in the world. There are countless ready-made building blocks (modules) and lots of help online.
  • Free and open: Python doesn’t belong to anyone alone. Everyone may use it, including for their own projects.
  • Grows with you: With the same basics you’ll later build games, websites, robots or AI programs.

For comparison: for decades, this was “Hello” in the programming language Java (only recent Java versions need less scaffolding) –

public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

– and this is it in Python:

print("Hello")

What can you do with Python?

AreaExamples
Artificial intelligencePrograms that recognise pictures or understand text. Many AI tools (e.g. PyTorch, TensorFlow) are used with Python.
Science & dataAnalysing measurements, drawing charts, exploring weather or space data.
Robots & electronicsLEGO SPIKE with Pybricks, Raspberry Pi, microcontrollers with MicroPython.
WebsitesThe “back” of websites – what happens on the server.
Games & graphicsSmall games, drawings, animations.
Automating everyday tasksRenaming files, sorting lists, doing sums – anything that would be boring by hand.

A few tasters – try them and change the numbers:

# Python handles huge numbers without complaining
print(2 ** 100)

# Sort a list
marks = [3, 1, 2, 1, 4]
print(sorted(marks))

# How many seconds are there in a normal year (not a leap year)?
print(365 * 24 * 60 * 60, "seconds")

And because pictures say more than numbers:

import turtle

t = turtle.Turtle()
t.speed(10)
t.color("darkviolet", "gold")
t.begin_fill()
for _ in range(5):
    t.forward(160)
    t.right(144)
t.end_fill()
t.hideturtle()

How does a Python program run?

Python is an interpreted language: a program called the interpreter first checks your whole program and then runs it step by step – without you having to convert anything first. If there’s a typo anywhere (SyntaxError), nothing runs at all, not even the lines before it. That’s why you can change something and try it again immediately.

Normally you install Python on your computer. Here at Codelix you don’t need to: Python runs right in your browser (with a tool called Pyodide). Your code stays on your device – nothing is uploaded.

Good to know: Programming doesn’t mean knowing everything by heart. Even professionals look things up all the time and make mistakes. What matters is reading errors, understanding them and trying again – and that’s exactly what you practise here.

How do you learn here?

  1. Lessons explain a topic with examples you can run and change right away.
  2. Quick checks ask you along the way: what does this print? Think first, then check.
  3. Tasks at the end of each lesson are checked automatically – with hints if you get stuck.
  4. In the training room you practise with ever-new tasks until it sticks.
  5. Later you’ll control a robot in the simulator – with real code for LEGO SPIKE.

Ready?

In the first lesson you'll write your very first program.

Start the first lesson