Semester 2 · Elective · 4 ECTS
Programming II
About the course
More advanced principles of functional and object-oriented programming in Python, from modules and packages, higher-order functions, nested functions and decorators to classes and objects, exception handling, and iterators and generators. The course covers more advanced techniques for processing text files, serialisation and working with structured, semi-structured and unstructured data from various sources, from txt, csv and json files to relational databases, with an emphasis on code organisation and reusability.Outcomes and topics
- Namespaces, modules and packages
- Functions with positional arguments and keyword arguments
- Recursive and anonymous functions
- Classes and objects in Python: defining your own classes and creating and using objects
- Built-in containers and user-defined objects
- Functions as first-class objects
- Higher-order functions: map, filter and reduce
- List, set and dictionary comprehensions
- Nested functions (closures)
- Decorators in Python
- Exception handling
- Iterators and generators
- Data serialisation
- Working with txt, csv and json files
- Working with relational databases in Python: establishing a connection and retrieving, updating and inserting data
Teaching and assessment
Teaching is delivered through lectures and exercises, with two independent assignments and an independent project to build an application to given specifications; the solutions are submitted via GitHub. Short tests account for 20 per cent of the grade, submitted solutions and exercise reports for 10 per cent, the final project, which is presented on a date in the examination period, for 50 per cent, and the final exam for 20 per cent, with a threshold of 50 per cent in each component.
Course leader and instructors
Teaching plan
The official, detailed teaching plan for the current academic year is always available on the Merlin pages of the course, to students enrolled in it. The general schedule of lectures is on the page Documents and decisions.