Being good at programming is not simply knowing a lot about a programming language, or how to write very fast programs. It is about:
In science, the last point is important, because reproducible research and open science is becoming the norm in certain fields of research, which means that others have to be able to read your code, and understand what you are doing, and be able to run it themselves. For this course, we are not just interested in whether your solutions are correct, but also whether it is possible to understand how you are solving the problem. You should always write code assuming that someone else may read it.
This course focuses on aspects of programming that would be useful to you in scientific research, but Python is a very popular language, and what you will learn will also be applicable if you decide to pursue a different career!
Python is an interpreted language, which means that the code is not compiled in advance, which makes it slower than languages like C/C++ or Fortran. Why therefore would we want to learn/use it?
Even though the Python logo has snakes in it, Python originally comes from the Monty Python comedy group ["Monty Python's Flying Circus", "Monty Python's Life of Brian", "Monty Python and the Holy Grail"]
.. a lot of Python documentation includes jokes related to Monty Python.
Up to January 1, 2020 version 2.7 of Python was still in use by some people. But since that date it is officially deprecated. If you have python 2.x installed, please make sure to uninstall it.
Always make sure to use Python 3
The code syntax of Python 2.x is almost identical to that of Python 3.x, but there are subtle difference. So if you use a Python program from someone else and it does not produce correct results, it could be due to this. The most common difference is that Python 2 evaluates
0 (because it considers 1 and 2 both integers, and performs an integer division) while Python 3 evaluates
0.5 (because it recognizes that the programmer probably doesn't want integer division but real division).