🧑‍💻 Python Practicals

MSc NLP and Master in Cognitive Science, IDMC - Université de Lorraine, 2023-2025.

Practicals 0, 1, 2 and 3

Please refer to Fanny Ducel’s website for these first practicals.

Practical 4

This practical serves as a recap of the first three lectures, covering the essential building blocks of Python. You'll reinforce your understanding of arithmetic and logical operations, and learn how to work with variables for data storage and manipulation in Python. You'll then dive into handling strings and controlling the flow of your programs using conditional statements (if, else, elif). Next, you'll explore the use of loops (for and while) to repeat actions efficiently. The practical will also guide you through organizing data using lists, and working with dictionaries to store data in key-value pairs. Finally, you'll practice writing functions to create reusable blocks of code.

Ready to get started? Download the recap practical below:

🧑‍💻 Download Recap Practical (TD4)

Practical 5

In this practical, you will solidify your understanding of Python by working with modules, packages, and functions. You'll start by creating a package with multiple modules, defining functions, and importing them into your Jupyter notebook. Through hands-on exercises, you will learn how to organize, manipulate, and preprocess data efficiently using Python’s built-in features and packages. This practical also introduces advanced topics like wrapper functions and documentation using NumPy-style docstrings, preparing you for more complex programming tasks.

Ready to get started? Download the practical 5 below:

🧑‍💻 Download Practical 5 (TD5)