Final Thesis – Base Python (Winter Semester 2025/2026)

This final assignment assesses your understanding of basic Python concepts,
logical thinking, and your ability to explain code in your own words.

The tasks combine programming, data handling, and reflection.
They are designed so that understanding and explanation are just as important as correct code.


Final Instructions for Comments and Code Quality

For every task, your code must include comments that:

🚫 AI-generated comments are NOT allowed.
🚫 Copy-paste explanations (from AI tools, websites, or other students) are not acceptable.

Your code may work perfectly — but without clear, personal comments, you will lose points.


Why comments matter

Programming is not only about producing correct output.
It is also about being able to:

In professional and academic contexts, readable and well-commented code is essential.


Comment Evaluation (applies to EVERY task)

For each task, you can earn:

Poor, generic, or AI-style comments may lead to point deductions.


Required Comment Structure

At the top of each script or function, include a short description like this:

"""
Description:
This script solves Task X of the final thesis.

It explains:
- what data is processed
- which logic is used
- what result is produced
"""

Good comments are rewarded!
For each task, you can receive an extra 0.5 points for clear, well-structured comments.
These points are not included in the main grade calculation, but they can help you if you are just below a grade boundary.

💡 For example: If you have 38 points (below passing level), but you wrote very good comments, you can receive enough extra points to pass (grade 4).

👉 So it is always worth it to write clear and meaningful comments!

Task 1: Even and Odd Numbers (5 p.)

Write a program that loops through the numbers from 1 to 20 and prints whether each number is even or odd.

1️⃣ Create a loop from 1 to 20. (2 p.)
2️⃣ Use an if-else statement to check even or odd. (2 p.)
3️⃣ Print each number with the label “even” or “odd”. (1 p.)


Task 2: Sum of Even Numbers (6 p.)

Write a program that calculates and prints the sum of all even numbers from 1 to 1000.

1️⃣ Create a loop from 1 to 1000. (2 p.)
2️⃣ Use a condition to select only even numbers. (2 p.)
3️⃣ Calculate and print the final sum. (2 p.)


Task 3: D3TD5T (12 p.)

Write a program that loops through a list (the list will be given next week).

1️⃣ (2 p.)
2️⃣ (1 p.)
3️⃣ (1 p.)
4️⃣ (3 p.)
5️⃣ (3 p.)
6️⃣ (1 p.)
7️⃣ (1 p.)


Task 4: Replace Characters (6 p.)

Write a program that goes through a list of fruits (the list will be given next week) and replaces all occurrences of a specific character (e.g., “a”) in each word with another character (e.g., “o”).

1️⃣ Read/ initialize the list of fruits. (1 p.)
2️⃣ Loop through each fruit and replace a character. (4 p.)
3️⃣ Print each modified fruit name. (1 p.)


Task 5: Remove and Add Friends with Loop and Replace (6 p.)

Write a program that:

1️⃣ (2 p.)
2️⃣ (2 p.)
3️⃣ (1 p.)
4️⃣ (1 p.)


Task 6: Search for a last name in a DataFrame (15 p.)

Description:

In this task, you will practice iterating over a DataFrame and stopping a search as soon as a condition is met. This time, you will search only by last name.

Preparation:

Steps:

1️⃣ (1 p.)
2️⃣ (1 p.)
3️⃣ (2 p.)
4️⃣ (6 p.) 5️⃣ (5 p.)

Task 7: 🎲 Game — “Lucky String Duel: You vs Computer” (15 p.)

Description:

In this advanced mini-game, you will play a “lucky string draw” duel against the computer!
Imagine you both have access to a magical bag containing 100 surprise words stored in a DataFrame.

You will receive this DataFrame next week.
Hint: Think carefully about how you access the word from the DataFrame!

DataFrame Structure:

Steps:

1️⃣ (1 p.)
2️⃣ (1 p.)
3️⃣ (4 p.)
4️⃣ (8 p.)
5️⃣ (1 p.)


Task 8: 🗺️ “Visualizing the Largest Cities in Europe Based on Coordinates” (15 p.)

Description:

You will work with the worldcities.csv file (SimpleMaps).

Instructions:

1️⃣ You will receive the download link to the World Cities dataset next week.
👉 Use the free version.

2️⃣ Unzip and note the path to worldcities.csv.

3️⃣ Load it into a pandas DataFrame and print all column names.

4️⃣ Filter cities in Europe using:

5️⃣ Print the city names from the filtered DataFrame.

6️⃣ Sort the DataFrame by population in descending order.

7️⃣ Create a bar chart (Matplotlib) for the top 10 largest cities:

1️⃣ (1 p.)
2️⃣ (1 p.)
3️⃣ (2 p.)
4️⃣ (4 p.)
5️⃣ (1 p.)
6️⃣ (2 p.)
7️⃣ (4 p.)


💡 Bonus Task: Object-Oriented Programming with Vehicles (15 p.)

Description:

Create a base class Vehicle with common attributes such as color, year, engine, name, and model.


Subclasses:


Data:


Steps:


1️⃣ Define the base class Vehicle with common attributes. (2 p.)
2️⃣ Define the subclass Car with extra attribute and method. (3 p.)
3️⃣ Define the subclass Truck with extra attribute and method. (3 p.)
4️⃣ Load both CSV files and create object lists. (3 p.)
5️⃣ Print total vehicle count and “VW” count. (2 p.)
6️⃣ Create a bar chart for vehicles older than 2000, with legend. (2 p.)


✅ Final p. Overview

Suggested grades

💬 Note about the Bonus Task

The points you collect from the bonus task are not included in the main grade calculation.
However, if your total points are just below a higher grade level, I will count your bonus task points to help you reach the better grade.

It is completely your choice whether you want to try the bonus task or not — but it can be a great opportunity to improve your final result!