Free preview
What Python is and what you can build
Reading · 10 min
Python is a general-purpose programming language created by Guido van Rossum and first released in 1991. "General-purpose" means it isn't tied to one job: the same language is used to automate office tasks, analyse data, build websites, control hardware and train AI models.
Why so many people start with Python
- It reads almost like English. Python uses indentation and plain words such as
if,for,inandnotinstead of lots of brackets and symbols. - It comes with "batteries included". The standard library that ships with Python can already read files, handle dates, do maths, work with CSV and JSON, send web requests and more.
- It has a huge community. Hundreds of thousands of free packages exist on the Python Package Index (PyPI), and almost every question a beginner has already has an answer online.
- It is free and runs everywhere: Windows, macOS, Linux and even small boards such as the Raspberry Pi.
What Python is used for
| Area | Examples |
|---|---|
| Automation | Renaming hundreds of files, filling in reports, cleaning spreadsheets |
| Data | Analysing sales, making charts, working with libraries such as pandas |
| Web | Back ends built with Django or Flask |
| AI and machine learning | Libraries such as scikit-learn and PyTorch |
| Education and science | Simulations, research data, teaching programming |
A first look
name = "Ada"
hours = 3
print(f"Hello, {name}! You studied for {hours} hours today.")
if hours >= 2:
print("Great work.")Notice three things. There are no semicolons. The line after if is indented: in Python, indentation isn't decoration, it tells Python which lines belong to the if. And the f before the string lets you place variables inside { }.
Interpreted, line by line
Python is an interpreted language: a program called the Python interpreter reads your file and runs it from top to bottom. You don't need a separate "compile" step, which makes it quick to try ideas. The trade-off is that Python is slower than languages such as C or Rust for heavy number crunching, which is why the big data and AI libraries do their heavy work in fast compiled code underneath.
How this course works
Each lesson explains a topic, shows short examples and ends with an exercise. Type the examples yourself rather than copying them: your fingers learn as much as your eyes. Quizzes check each module, a mid-course assignment practises functions, and the final project is a real tool you can show people.
Try it
What would you automate?
Write down three boring, repetitive tasks you do on a computer: at work, at school or at home. Keep the list. By the end of the course you'll be able to automate at least one of them.
Like this lesson?
Python Programming has 20 lessons with exercises, quizzes and a final project.