Lecture 3: Loops and lists
Contents
Lecture 3: Loops and lists#
In Lecture 3 we dig deeper in learning the fundamentals of Python programming and programming constructs more generally. In particular we will teach you
How to write and use for loops and while loops.
When to use the list object to solve problems.
How to apply loops and lists alongside functions,conditionals and logic to solve more involved problems.
The weekly tasks are split up into a series of sequential notebooks. Any of these can be opened below by clicking on them. Some of these are interactive notebooks, where you will run and/or write code in the cells. To open any of the notebooks interactively, first click on the section, then click on the rocket and select “Colab”.
Weekly tasks#
- Loops and lists: an overview
- Using a for loop: interactive
- Using a for loop: interactive - SOLVED
- For loops: exercises
- For loops: exercises - SOLVED
- The while loop: interactive
- The while loop: interactive - SOLVED
- Writing sums as functions: INTERACTIVE
- Writing sums as functions: INTERACTIVE - SOLVED
- Lists (interactive)
- Lists (interactive) - SOLVED
- Lists: exercises
- Lists: exercises - SOLVED
- Indices and ordering: INTERACTIVE
- Indices and ordering: INTERACTIVE - SOLVED
- Lists: some other list operations
- Lists: some other list operations - SOLVED
- Summary exercises
- Summary exercises - SOLVED