Little novice program written in Python
Nick Craig-Wood
nick at craig-wood.com
Fri Apr 25 08:30:03 EDT 2008
Rogério Brito <rbrito at ime.usp.br> wrote:
> I'm just getting my feet wet on Python and, just for starters, I'm coding some
> elementary number theory algorithms (yes, I know that most of them are already
> implemented as modules, but this is an exercise in learning the
> language idioms).
When you are up to speed in python I suggest you check out gmpy for
number theory algorithms.
Eg :-
import gmpy
p = 2
while 1:
print p
p = gmpy.next_prime(p)
--
Nick Craig-Wood <nick at craig-wood.com> -- http://www.craig-wood.com/nick
More information about the Python-list
mailing list