Make this work for both Python 2 and 3, remove trailing whitespace

Hello, I wanted to give a hand on your learning journey, if you think it's a good idea. I also wanted to make my first pull request. :bowtie: 

What I did here was to make this work for both Pythons 2 and 3. The import from `__future__` seems ok, but the hack regarding the `raw_input` and `input` function is a little ugly but I couldn't find anything prettier.

I have more ideas on how to improve the code if you are interested.