John Ramey

Don't think…compute.

Project Euler

Anthony turned me onto this new project called Project Euler.  On the site, there are currently 202 computational math problems ranging from easy to extremely difficult.  Several of the problems can be brute-forced in order to find a solution, but there are some that are just not possible to solve in this manner in this lifetime, and thus, clever methods are needed to solve the more difficult problems.  As you may guess, I am becoming obsessed with this site; last night, I stayed up until 6:30am working on as many as I could.  So far, I have solved 14 of them.

I was not too savvy with Python until now that I am restricting myself to using one and only one programming language for these problems; I have learned much about the language, and I’m quite impressed.  It is always great to have mundane aspects of coding shot into oblivion because they really just are not needed anymore: well, maybe some will continue to believe C is necessary for all.

In the next couple of days, I am going to start uploading my code for these solutions; if anyone cares, maybe it will be a learning experience for us all.  For the most part, I have the math know-how to solve these problems within the recommended minute, but I ask that any and all advice be given to improve my Python skills.

Posted in Code, Python

One Response


  1. Ben

    If you’re still keen on learning Python, I would recommend that you learn using a tool like IDLE (available from the official Python site). It’s like a command-line style interpreter that will run code as you enter it, which makes it great for single-stepping through to make sure you are doing what you think you are doing.

    Also, I would recommend any book in the Pragmatic Programmer series (www.pragprog.com). While they don’t have a specific Python book, they do have “Practical Programming: An Introduction to Computer Science Using Python” and “Data Crunching: Solve Everyday Problems using Java, Python, and More”. Since they are available in print and as e-books, maybe you can access the e-book versions through one of Baylor’s library subscriptions. The book “Programming Python” should be available through Baylor’s subscription to O’Reilly’s Safari Books service, which should give a good overview of the basic language. To really get to know what you can do with Python, try something like the “Python Cookbook” (http://www.amazon.com/exec/obidos/ISBN=0596001673) since the best way to learn is by example.

    Of course, all this comes from someone who has this —->||<—- much experience in Python. Python and Ruby are similar level languages and the Ruby equivalent of these taught me enough to do grad level projects in Ruby in only about 2 weeks, so hopefully you will see similar results :)

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.