Hacker Rank Python Practice Problem