Assignment 2 in Python