Module 2: Basic Python
Class ressources
Organisation
In class: 15 min lecture + 25 minutes exercises + 5 minutes review:
- Hour 1: concepts 1, 2, 3
- Hour 2: concepts 4, 5
Concepts
- Assignment and scalar types
- Strings
- Lists, tuples and sets
- Dictionaries
- Tracebacks
- Introduction to Pixi & executing .py files from the shell
- Executing .py files in VS Code
- Executing notebooks in vscode
Learning objectives
After this lesson, you should be able to:
- Assignment and scalar types:
- List several built-in scalar types in Python
- Assign and manipulate scalar variables in Python
- Convert variables between different types
- Strings
- Lists, tuples and sets:
-
Dictionaries:
- Assign flat and nested dictionaries in Python
- Access elements in flat and nested dictionaries
- Update or insert elements in dictionaries
- Explain some benefits of labeled data structures
-
Tracebacks:
- Read and interpret tracebacks
- Identify common errors in Python code
- Use tracebacks to debug code