[root@www ~]# python twentynine.py
9183
Started at: Fri Oct 10 20:34:29 2008 Ended at: Fri Oct 10 20:34:29 2008
[root@www ~]# cat twentynine.py
# -*- coding: utf-8 -*-
"""
<+ MODULE_NAME +>
Project Euler Problem Set
<+ DESCRIPTION +>
Solutions in Python to the problems at http://projecteuler.net
Licensed under the Creative Commons license; see http://creativecommons.org for more details. In short, this means you can freely reuse, modify and distribute this program, also commercially, for as long you provide a proper attribution.
Copyright by Jonathan Mark, jonathanmark.com/aristede.com, jmark@aristede.com
>>> print 881 + 1
882
"""
import time
starttime = time.asctime()
results = {}
for a in range(2,101):
for b in range(2,101):
results[a**b] = 0
print len(results)
print "Started at: ", starttime, " Ended at: ",time.asctime()
if __name__ == "__main__":
import doctest
doctest.testmod()
Friday, October 10, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment