Sum and Prod - Python HackerRank Solution