← All weeks and tools

Workshop: Python

Cultural Data Analysis · Week 1: Python

Practise the Python from the lecture in a notebook: working with the notebook environment, lists and arrays, sequential and event-driven programs, and a first real-life dataset.

Open in ColabWeek1_Workshop.ipynb

First: save your own copy. Unless the notebook is already in your own Google Drive, Colab does not keep your changes. Go to File → Save a copy in Drive and work in the copy that opens in a new tab. You find it later in Google Drive, in Colab Notebooks.

How it works

  1. Run the first code cell: it sets up the checks for the exercises.
  2. Work from top to bottom. Cells marked #Keep cell are ready to run; in the other exercise cells you write the code yourself.
  3. Below an exercise, run q1.check() (and so on) to check your answer. q1.hint() gives a hint and q1.solution() the solution: try first.

What is in the notebook

The code-along for this week's lecture: Python Tutor exercises.