This module aims to give students a broad background on the use of Python as a programming language. This knowledge is the basis for all subsequent modules in the students’ curriculum that require the usage of programming tools, such as implementing numerical methods for physics or handling data from lab-based activities. On the one hand, this module equips students with the core expertise to use Python in science-related applications, such as inputting data from files and creating customized plots. On the other hand, it develops students’ ability to critically evaluate the performance of existing codes, and to independently retrieve existing subroutines from standard Python libraries.
A use conditional and iteration statements to perform coding tasks; B develop complex codes logically by interfacing self-written subroutines; C perform operations (numerical, input/output, argument passing, etc.) on different kinds of compound data types such as arrays, lists, and dictionaries; D produce user-customized 1D and 2D plots; E import and use standard Python libraries to simplify the code structure.
This module is delivered over 13 teaching weeks in year 2, semester 1. Every week, students are expected to: - attend two hours of formal lectures, which serve to introduce new programming concepts from a theoretical perspective, and to show examples of their usage and usefulness; - attend two hours of computer lab activities, which give students the opportunity to practice their code-development skills and to apply the concepts learned in the formal lectures; - devote 7-8 hours to independent study and coding practice on personal laptops or PC made available by the University. Students are encouraged to utilize AI tools and to critically explore the strengths and limitations of generative AI for developing code. In particular, students are required to always test AI coding output against their personal expertise on the subject.