Python code for STK4021 in UiO