Skip to content

📚 Python for beginners — Week 1

A class page with code, a PDF syllabus, a schedule and exercises.

An open notebook beside a laptop

Python for beginners 🐍

Week 1: variables, input and your first functions.

Course syllabus (PDF)PDF · 1 kBDownload
Read before the first class

This week

Day

Topic

Homework

Mon

Variables & types

Exercise 1

Wed

Input and f-strings

Exercise 2

Fri

Functions

Mini project

Your first program

name = input("What is your name? ")
print(f"Hello, {name}! 👋")

python

Run it with python3 hello.py in your terminal.

def average(numbers):
    return sum(numbers) / len(numbers)

print(average([4, 8, 15, 16, 23, 42]))  # 18.0

python

Exercises

Exercise 1 — Temperature converter

Ask for a temperature in Celsius and print it in Fahrenheit (F = C × 9/5 + 32).

Exercise 2 — Tip calculator

Ask for the bill and the tip percentage; print the tip and the total.

Solution to Exercise 1 (no peeking!) 🙈

c = float(input("Celsius: "))
print(c * 9 / 5 + 32)

python

Bring your laptop with Python 3.12 or newer installed.

Join the class chat

Photo: Andrew Neel on Unsplash.

From Handpage Demo

h-pnzhqyeuNov 1, 2026 7 views