University of Geneva · CUI BSc · Algorithmics & Data Structures

Environment Setup & Python Syntax

Seminar 1

Who We Are

Prof. Katarzyna Wac, Ph.D.
Prof. Katarzyna Wac, Ph.D.
Alexander Horst
Alexander Horst

Objectives for CUI BSc ALGs

  1. Introduction to the Python programming language
  2. Concept of algorithms and data structures for collections
  3. Search and sorting methods
  4. Concept of algorithm complexity
  5. Recursion and divide-and-conquer algorithms
  6. Tree and graph structures
  7. Number representation and numerical algorithms
  8. Problem complexity, NP-complete and undecidable problems

Building Blocks

Building Blocks
Note: lectures do not explain one-to-one the seminar content. Lectures provide the context of the algorithm and data management.

Grades

  • 70% — written exam (180 min)
  • Closed-book, written by hand on paper
  • Seminar-content only (Algorithmics AND Python)
  • Half is multiple-choice with deduction, half is open-ended questions
  • Minor syntax errors overlooked if meaning remains clear
  • Questions in English and French — answers can be in either
  • 30% — graded Project + peer-review submission
  • Your code: pushed to GitLab by 19 May 2026 23:59
  • Peer-review: completed by 31 May 2026 23:59

Student Project (30% of grade)

  • Goal: learn algorithmics by working on a single, real dataset
  • Dataset: step-activity data from 12 real Withings ScanWatch users
  • Apply course algorithms — sorting, searching, DP, graphs — to the data
  • Justify every algorithmic choice in your README
  • Optional: connect your own smartphone via the Withings App and analyse your own data
  • Deliverables (details in Seminar 4):
  • Code repo + README explaining your algorithms (15% of final grade)
  • Peer review of one randomly assigned colleague's code (15% of final grade)

Schedule

Schedule
Note: this is not a Python course — we cover the minimum to go deeper into algorithmics. You can skip the first 3 weeks if you are comfortable in Python, but we suggest you do at least the exercises as the material will be relevant for the exam.

Why Learning Python?

Why Learning Python?
[tiobe.com/tiobe-index]
  • Simplicity: readable, one-line Hello World
  • Relevance #1 language (TIOBE Index)
  • Versatile: data science, backend, scripting
  • Same algorithmic concepts as C/Java, cleaner syntax

Seminar Playbook

  • Help each other: collaboration and discussion are encouraged
  • Talking is allowed: this is a workshop, not a lecture hall
  • ChatGPT is allowed: but question its output, never copy blindly
  • Understand every line before you use it
  • Questions during class? ask anytime
  • Questions outside class? email me
  • Exercises are your exam prep — treat them seriously
  • Coming is optional: but we'll be glad to see you here especially from week 4 onwards (project and algorithmics)!

Today's Focus

  • By the end of today, you will be able to:
  • Set up and use a virtual environment (venv)
  • Work with Python's core types and convert between them
  • Use f-strings for modern string formatting
  • Apply PEP-8 coding style conventions
  • Use basic Git commands to version-control your work

Today's Exercises

  • Ex 1 — Greeting script: ask name & age, compute birth year
  • Ex 2 — Fix 11 PEP-8 violations in a provided snippet
  • Ex 3 — Type conversions: parse input, cast between int / float / str
Today's Exercises
University of Geneva · CUI BSc · Algorithmics & Data Structures

Thank You & Have Fun!