Project Euler
Tuesday, December 23rd, 2008I arrived in Frankfurt after a pretty miserable overnight train ride. The compartment I was in also had a family with two small children. I’ve also developed a painful sore throat in the last few days. Between the kids and the throat, I wasn’t getting any sleep anyway, so I hid out in the restaurant car, chain-drinking teas (and burning through the last of my Polish zloty), reading and coding.
A while back, my friend Nick introduced me to Project Euler, which is a really cool (well, not really cool, but nerd-cool, which is better anyway) collection of little mathematical puzzles that are best solved through the application of computer programming.
I’ve been looking to learn Python for a while now, so I decided to start working through some of the Project Euler problems as a way to learn Python. I did the first two on the train: summing all natural multiples of 3 or 5 below 1,000, and summing the even Fibonacci numbers below 4 million.
If you care, my code is below:
(more…)