Python · 27 problems · 3 project ideas

Problem sheet

Beginner

13 problems

Hello, print()

print · strings · comments

Variables and f-strings

variables · assignment · f-strings

Types and Conversion

types · int · float

Reading Input

input · stdin · conversion

Arithmetic Operators

operators · integer-division · modulo

Strings: Indexing, Slicing and Methods

strings · indexing · slicing

Conditionals: Letter Grades

conditionals · if-elif-else · comparisons

While Loops: Read Until Done

while · break · sentinel

For Loops and range: FizzBuzz

for · range · iteration

Greeting Formatter

functions · strings · f-strings

Sum and Mean of a List

loops · accumulator · tuples

Filter Even Numbers

list-comprehension · modulo · filtering

Vowel Counter

strings · dictionaries · counting

Intermediate

8 problems

Fibonacci Sequence

loops · sequences · tuple-unpacking

Importing the Standard Library

modules · import · math

Unique Words in Order

sets · strings · deduplication

Functions as Values

higher-order-functions · lambda · args-kwargs

Gradebook Aggregation

dictionaries · grouping · sorting

Validated Factorial

exceptions · validation · loops

Matrix Transpose with Validation

nested-lists · list-comprehension · zip

Safe Division with Exceptions

exceptions · try-except · error-handling

Advanced

6 problems

Guessing Game Feedback

loops · break · state-machines

Files, CSV and JSON

files · with · pathlib

Text Statistics from stdin

stdin · io · strings

Classes: A Bank Account

classes · objects · methods

Inheritance, Special Methods and Dataclasses

inheritance · polymorphism · super

Writing Unit Tests

testing · unittest · edge-cases

Project ideas

3 project ideas

Expense Tracker CLI

Project idea · command-line · files · json

Quiz Game with High Scores

Project idea · games · classes · testing

Text Adventure Engine

Project idea · games · object-oriented-design · parsing