Problem 4 done with Python in an object oriented manner.