Python solution for 08-One, Two, Three by @MartinThoma