This repository collects slides, exercises and other supporting material used in the Python language courses held by the GC3 at the University of Zurich.
The material in this course covers the basics of Python programming and object-orientation. We assume that students are already familiar with scripting languages (e.g. bash, perl) and have already written some computer programs.
The files named partNN.tex
are used as slide decks during the
lessons. Exercises are interspersed in the slides; solutions are
provided in the .py
files.
To create the PDF files for the slides, you need to download the
GC3 beamer style.
Place the GC3 beamer style files in the directory there the
partNN.tex
files are, then type make all
.
We normally deliver the course in two sessions, of one day each:
-
The first day of the course introduces Python syntax and the fundamental data types.
-
The second day of the course covers Object-oriented Python: the basic concepts of object-oriented programming (class, instances, interfaces and inheritance) are introduced along with Python code examples. Then we delve into object-oriented Python idioms that every working Python programmer should know about.
- Introduction
- Workstation setup
- Downloads: welcome.py
- Basics 1: data types, operators, assignment, functions
- Basics 2: sequences and iteration
- Everything is an object!
- String manipulation, file I/O
- Object-oriented programming: basics
- Special methods
- Downloads: vector2.py, vector3.py, vector4.py, vector5.py
- Object-oriented programming: inheritance
- Downloads: complexnum.py, vector_and_complexnum.py, wt.csv
- Solutions to exercises: ex08a.py, ex08b.py, ex08c.py, ex08d.py, ex08e.py, ex08f.py
- Unit tests and doctests
- Downloads: vector6.py
- Exceptions and error handling
- Do not reinvent the wheel: a survey of useful Python libraries
We welcome contributions from other Python instructors, programmers, students and enthusiasts in general :-). Please submit a pull request or send us an email at mailto:info@gc3.lists.uzh.ch.
The Python Course by the Grid Computing Competence Center, University of Zurich is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Permissions beyond the scope of this license may be available at mailto:info@gc3.lists.uzh.ch.