Re: [Tutor] prime test problem

2010-08-21 Thread Alan Gauld
"Roelof Wobben" wrote It worked now. x=x+1 must have the same indention als the if then and the return. Or more specifically, it must be indented further than the while statement. The fact thatv the other commands inside the while loop happen to be an if/else is incidental x=1 while x <

Re: [Tutor] prime test problem

2010-08-21 Thread Roelof Wobben
Hello, Thank you. It worked now. x=x+1 must have the same indention als the if then and the return. Roelof > Subject: Re: [Tutor] prime test problem > From: evert@gmail.com > Date: Sat, 21 Aug 2010 19:24:51 +0200 > CC: tutor@python.org > To: rwob

Re: [Tutor] prime test problem

2010-08-21 Thread Evert Rol
Ah yes, and either use "is een priemgetal" or "is a prime number", not a mix of both (sorry, couldn't help myself ;-). Evert > > Roelof > > > > From: st...@pearwood.info > > To: tutor@python.org > > Date: Sun, 22 Aug 2010 02:

Re: [Tutor] prime test problem

2010-08-21 Thread Roelof Wobben
al" else : print 7, "is geen prime getal" But this one gets in a indefinitive loop. Roelof > From: st...@pearwood.info > To: tutor@python.org > Date: Sun, 22 Aug 2010 02:49:26 +1000 > Subject: Re: [Tutor] prime test problem > > On Sun, 22 Aug 2010 1

Re: [Tutor] prime test problem

2010-08-21 Thread Steven D'Aprano
On Sun, 22 Aug 2010 12:41:03 am Roelof Wobben wrote: > Hello, > > I know. > I have read them all I believe You've read all 64 million pages that Google finds? Wow, you must be a fast reader! Well done! > but I can't see how I can convert the > algebra to a working programm. Have you *tried*?

Re: [Tutor] prime test problem

2010-08-21 Thread Evert Rol
t and ask for advice; your current question is a bit too general, and thus harder to answer. Evert > > Roelof > > > Date: Sat, 21 Aug 2010 19:15:03 +0530 > Subject: Re: [Tutor] prime test problem > From: nitin@gmail.com > To: rwob...@hotmail.com > CC: tutor@p

Re: [Tutor] prime test problem

2010-08-21 Thread Roelof Wobben
Hello, I forget to mention that I try to follow this book : Think like a computer scientist and I'm now working on chapter 4. Roelof From: rwob...@hotmail.com To: tutor@python.org Date: Sat, 21 Aug 2010 14:41:03 + Subject: Re: [Tutor] prime test problem Hello, I kn

Re: [Tutor] prime test problem

2010-08-21 Thread Roelof Wobben
Hello, I know. I have read them all I believe but I can't see how I can convert the algebra to a working programm. Roelof Date: Sat, 21 Aug 2010 19:15:03 +0530 Subject: Re: [Tutor] prime test problem From: nitin@gmail.com To: rwob...@hotmail.com CC: tutor@python.org For

Re: [Tutor] prime test problem

2010-08-21 Thread Robert Berman
10 9:36 AM To: tutor@python.org Subject: [Tutor] prime test problem Hello, I have to make a programm which can test if a number is a prime. I know a prime is a number which can only be diveded by 1 and itself. One way is was thinking about is to make a loop which try if % has output 0. But

Re: [Tutor] prime test problem

2010-08-21 Thread Nitin Das
For this problem u will get lots of solutions on the net. e.g wilson's theorem , sieve of eranthoses etc. --nitin On Sat, Aug 21, 2010 at 7:05 PM, Roelof Wobben wrote: > Hello, > > I have to make a programm which can test if a number is a prime. > I know a prime is a number which can only be d

[Tutor] prime test problem

2010-08-21 Thread Roelof Wobben
Hello, I have to make a programm which can test if a number is a prime. I know a prime is a number which can only be diveded by 1 and itself. One way is was thinking about is to make a loop which try if % has output 0. But that don't work. Can someone give me a hint what's the best