Reading material#
The main course material is Think Python 3rd edition by Allen Downey, a comprehensive book for university-level beginners. The syllabus for courses 02002/02003 closely follows the book, though we introduce a few concepts in a different order, and we omit some topics entirely. For each week, we provide a link to the relevant chapter in the online version of the book. The 3rd edition of the book is not available as a PDF, but Think Python 2nd edition, which is only slightly different, can be downloaded.
In addition to the book, we will use supplementary material in some weeks, mainly from the CS50 course and the Python tutorial at W3Schools.
CS50 is an introductory programming course from Harvard University with extensive public resources. When referring to CS50, we will link to lecture notes, but you are welcome to explore their exercises or lecture recordings, which are both inspiring and informative. Note that CS50 introduces some topics not covered in 02002/02003, such as the Pillow library, pytest, regular expressions, and advanced object-oriented programming.
W3Schools is an online platform for learning programming and web development. Their Python tutorial covers both basic and advanced topics, so it may be too detailed for beginners. However, W3Schools is great if you need to check Python syntax, and for this, they provide an excellent try-it editor.
Additional resources used to a limited extend include:
Python Programming from University of Helsinki
The official Python tutorial
The official Python documentation
Overview of reading material for all weeks#
Week 1: Introduction#
The content of this week roughly corresponds to Think Python (TP), Chapter 1 Programming as a way of thinking. The small differences between the book and the course are in the order of introducing concepts: We postpone a formal definition of types to next week, but we use print statements and comments already this week (the book introduces print statements and comments in Chapter 2).
Week 2: Variables and types#
The content of this week corresponds to Think Python (TP), Chapter 2 Variables and Statements supplemented with the first three sections of Chapter 5 Conditionals and Recursion. In Chapter 2, you can skip the part about the state diagram, as we do not use state diagrams in our course.
You can also find the content of this week in the lecture notes for the CS50 course, Lecture 0 Functions, Variables. We cover sections on integers, floats (two sections), and strings (two sections).
Week 3: Conditionals#
This week corresponds to parts of Think Python (TP) Chapter 5 Conditionals and Recursion. The sections covered are: if statement, The else clause, Chained conditionals, and Nested conditionals.
Alternatively, conditionals are also covered in the lecture notes for the CS50 Course, Lecture 1 Conditionals, only the first 4 sections.
Week 4: Loops#
In the Think Python (TP) book, loops are covered in Chapter 7 Iteration and Search. However, the book shows looping on strings which we have not yet studied, and it only explains for-loops. In this course, we teach both the for-loop and the while-loop. Therefore, this week is better aligned with the lecture notes of the CS50 course, Lecture 2 Loops, first three sections.
Week 5: Functions#
In the Think Python (TP) book, void functions are covered in Chapter 3 Functions (you can skip the section on stack diagrams). Functions with return statements are covered in the first 5 sections of Chapter 6 Return Values.
In the CS50 course, the concept of functions was introduced already in Lecture 0 Functions, Variables, section Def.
Week 6: Lists#
In the Think Python (TP) book, lists are covered in Chapter 9 Lists.
Week 7: Strings#
In the Think Python (TP) book, strings are covered in the first 5 sections of Chapter 8 Strings and Regular Expressions. Additionally, we also cover f-strings, which the book introduces in the second section of Chapter 13 Files and Databases.
Week 8: Dictionaries and tuples#
In the Think Python (TP) book, dictionaries are covered in Chapter 10 Dictionaries, you can skip the section on memos. Tuples are covered in Chapter 11 Tuples, and we cover the first 4 sections.
Week 9: Files#
In the Think Python (TP) book, filenames and paths are covered in the first section of Chapter 13 Files and Databases: Filenames and paths. Reading files is explained already in Section 7.2. Reading the word list. Writing to files is not covered in TP. For writing and reading files, look at the first three sections of the lecture notes for the CS50 Course Lecture 6 File I/O.
Week 10: Classes I#
This week roughly corresponds to the first 5 sections of Think Python (TP) book Chapter 14 Classes and Functions. We also introduce the concept of methods and the __init__
method, which in the book is covered in Chapter 15 Classes and Methods, sections 1 to 3 and section 6.
Looking at the lecture notes for the CS50 course, this week corresponds to the first two sections of Lecture 8 Object-Oriented Programming.
Week 11: Classes II#
In the Think Python (TP) book, inheritance is covered in Chapter 17 Inheritance. Operator overloading is covered in one section of Chapter 15 Classes and Methods.
Looking at the lecture notes for the CS50 course, this week is covered in two sections of Lecture 8 Object-Oriented Programming, sections on inheritance and operator overloading.
Week 12: Numpy and matplotlib#
In this course, we cover very basics of NumPy and Matplotlib, and each of these libraries might require a course of its own.
A good place to start is the Numpy Absolute Beginners Tutorial. Another good introduction to NumPy is provided by W3Schools Introduction to NumPy.
At W3Schools, you can also find a good Matplotlib Tutorial. To get started with Matplotlib, you can also check the Matplotlib Quick Start. And to see what Matplotlib can do, check the Matplotlib Plot Types.
Week 13: Modules#
This weeks covers roughly Chapter 13 of the book WhirlwindTour Of Python, Modules and Packages.
A similar content is covered in Kaggle Tutorial Working with External Libraries.