added an answer to the first problem in python