Created solution to Intermediate #2 in Python