- Jacopo Rigosa ([email protected])
- Alberto Sartori ([email protected])
-
how to use python:
- interactively (shell, jupyter)
- script (...)
-
identifiers, keywords, operators
-
literals, compund data structures (i.e., tuple, list, set, dict)
-
control flow tools (i.e., conditional, loops, reminder, context, exceptions)
- special looping functions (i.e., reversed,zip,enumerate,sorted)
-
definition of a function
- keyword arguments
- positional arguments
- lambda expressions
- function annotations
-
exercises/lecture_1_exercises.py:
- is_palindrome(string)
- histogram_letters(string)
- get_most_frequent(list)
- which_duplicates(list)
- compute_factorial(a)
- is_prime(a)
- is_divisor(a,b)
- https://docs.python.org/3/tutorial/ introduces many Python’s features by example
- https://docs.python.org/3/library/ standard library that is distributed with python
- https://docs.python.org/3/extending/ how to write Python modules in C or C++
- https://docs.python.org/3/reference/ for syntax and “core semantics”
Part of the material was taken from this collection of notebooks