Fundamentals of Python Programming II

Lecture Slides Lecture Slides (pdf) Lecture Slides (ipynb)

Tutorial Exercise Tutorial Exercise (pdf) Tutorial Exercise (ipynb)


As in other programming languages, functions are crucial for building modular programs. In this week we look at control flow mechanisms and discuss function definition and invocation in Python.

Required Readings

  • Guttag Chs 4: Functions, Scoping and Abstraction, 6: Recursion and Global Variables;

Additional Readings

  • Guttag Chs 7: Modules and Files, 8: Testing and Debugging, 9: Exceptions and Assertions.

Tutorial

  • List and dictionary comprehensions;
  • Working with functions in Python.