[Tutor] prime test problem

Steven D'Aprano steve at pearwood.info
Sat Aug 21 18:49:26 CEST 2010


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*?

Perhaps you should try something a little bit less ambitious. Write a 
program to test whether a number is divisible by 3. Then write a 
program to test whether a number is divisible by 3 or 5. Then write a 
third program to test whether a number is divisible by 3, 5 or 7. 

Then generalise that third program.

Off you go. Come back when you have some code. Even if it isn't working 
code, at least try something.



-- 
Steven D'Aprano


More information about the Tutor mailing list