PyPython

Learn Python – tutorial, cheatsheet & exercises

Python is one of the most popular programming languages in the world. The code reads almost like English, and indentation replaces curly braces, which makes Python ideal for getting started.

At the same time, Python is extremely powerful: data science (pandas, NumPy), machine learning (PyTorch, scikit-learn), web development (Django, Flask, FastAPI) and automation are core areas. A huge ecosystem (PyPI) provides a ready-made package for almost any task.

Data scienceAI/MLWeb backendAutomationScripting

Hello World in Python

print("Hello World!")

print outputs text to the console – no main, no parentheses needed.

How to get started with Python

Install Python from python.org (or with brew install python on a Mac, winget install Python.Python.3 on Windows). Check the installation in the terminal:

python3 --version

Start interactive mode with python3 or run a file:

python3 hallo.py
TipFor your own projects, a virtual environment is worth it: python3 -m venv .venv and then source .venv/bin/activate. This keeps packages separate for each project.

At a glance

First released1991
CreatorGuido van Rossum
ParadigmMulti-paradigm (OOP, functional, procedural)
TypingDynamic, strong
ExecutionInterpreted (bytecode VM)
File extension.py

Test & practice

Interactive quiz, timed exam with certificate, and exercises with an editor:

Python compared

Hello World: Python comparedVariables: Python comparedConditionals: Python comparedLoops: Python comparedFunctions: Python comparedLists and Arrays: Python comparedDictionaries and Maps: Python comparedClasses and Objects: Python comparedError Handling: Python comparedReading Files: Python compared