Lectures
I. General description
This course is a basic introduction to Python. The following topics will be covered:
- Basic notions: computer, algorithms, programming languages
- Introduction to Python and Visual Studio, interpreter and scripts
- Basic data types (Numbers, booleans, strings and lists)
- Control flow (if, for and while)
- Functions
- Modules, Packages
- Numpy
- Matplotlib
- Advanced data types (tuples, dictionaries and classes)
- Input/output
Please bring your own computer with you in all the lectures. To run Python scripts, you will be free to use the IDE you want or to work directly from shell. In the lessons, Visual Studio Code will be the adopted IDE, we recommend you to use it as well if you have no experience about programming.
If you want to work locally on your computer make sure to install Python3, Visual Studio Code (if you use this IDE), pip, numpy and matplotlib (see procedure below). In your thinlinc account they are already installed.
II. Installation procedure
If you want to use your own laptop, please follow this procedure to install Python3, VSCode, pip, numpy and matplotlib:
-
Install Python3, last version 3.12.6: https://www.python.org/downloads/
-
Install Visual Studio Code: https://code.visualstudio.com/
-
Open Visual Studio Code and download the extension Python Intellisense (Code -> Preferences -> Extension)
-
Select the Python3 interpreter in Visual Studio Code (check that it is the Python3 executable that was installed in step 1)
-
Install pip: https://pip.pypa.io/en/stable/installation/ (useful to easily install packages)
-
Install numpy (use pip): https://numpy.org/install/
-
Install matplotlib (use pip): https://matplotlib.org/stable/users/installing/index.html
If you want to use Thinlinc, see information here: https://tl.math.uzh.ch/.
III. Course material
- Slides, example files
- Python Tutorial, Guido van Rossum and the Python development team
IV. Exercises and admission to the exam
A worksheet will be uploaded weekly (generally every Monday morning) on the website. Deadline for the submission of the exercises is on Sunday at 22:00. Note that the first worksheet (worksheet 0) will not be graded, it will be dedicated to set up your python environment and VScode, and very basic exercises to check everything works properly.
Prerequisite for the participation in the exam is the successful participation in the exercises, i.e. 50% of the total score in the exercise sheets is required.
V. Exam
The exam will be in the same spirit as the exercise sheets that you had during the course. You receive a sheet of tasks and you have to code them and upload the solution. You are supposed to use your own laptop. It is open book, open Internet, only you cannot:
- communicate with other people,
- use AI.
More communication coming soon regarding the dates and rooms of the exam and the repetition.