I took these problems from following sites: http://projecteuler.net/index.php?section=problems http://pythonprogramming.jottit.com/