Added Python solutions to problems 38 - 40