Problem one in Python and Haskell.