Hi, I'm new at python as I just started to learn it, but I found out something weird. I have wrote a little program to compute Mersenne number:
# Snipet on def is_prime n: for i in range(2, n): if (n % i) == 0: return 0 else: return 1 for a in range(2, 10000000): if (is_prime(a) and is_prime(2**a-1)) print 2**a-1, " is a prime number" # Snipet off This program raise MemoryError. But this one: # Snipet on def is_prime n: for i in range(2, n): if (n % i) == 0: return 0 return 1 # the change is here for a in range(2, 10000000): if (is_prime(a) and is_prime(2**a-1)) print 2**a-1, " is a prime number" # Snipet off Does not! Why ?? Thx. -- http://mail.python.org/mailman/listinfo/python-list