Re: Weird MemoryError issue

2006-07-19 Thread jedi200581
John Machin wrote: > On 20/07/2006 6:05 AM, John Machin wrote: > > On 20/07/2006 1:58 AM, [EMAIL PROTECTED] wrote: > >> def is_prime n: > > > > Syntax error. Should be: > >def is_prime n: > > Whoops! Take 2: > > Should be: > > def is_prime(n): Sorry for that, I was not able to cut-paste the c

Re: Weird MemoryError issue

2006-07-19 Thread John Machin
On 20/07/2006 6:05 AM, John Machin wrote: > On 20/07/2006 1:58 AM, [EMAIL PROTECTED] wrote: >> def is_prime n: > > Syntax error. Should be: >def is_prime n: Whoops! Take 2: Should be: def is_prime(n): -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird MemoryError issue

2006-07-19 Thread John Machin
On 20/07/2006 1:58 AM, [EMAIL PROTECTED] wrote: > 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: Syntax error. Should be: def is_prime n: > for i in

Re: Weird MemoryError issue

2006-07-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > 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: >

Weird MemoryError issue

2006-07-19 Thread jedi200581
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, 1000): if (is_p