A Maths Assignment solved in Python