prime number

Tim Leslie tim.leslie at gmail.com
Sun May 29 23:15:05 EDT 2005


On 29 May 2005 19:55:32 -0700, lostinpython
<shanna_perkins_02 at hotmail.com> wrote:
> I'm having trouble writing a program that figures out a prime number.
> Does anyone have an idea on how to write it?  All I know is that n > 2
> is prim if no number between 2 and sqrt of n (inclusivly) evenly
> divides n.

This sounds remarkably like a homework problem, so I'm not going to
give you a full answer. Perhaps if you could be more specific about
which part's giving you trouble we could help you out with that.

If it finding square roots? is it checking for divisibility? is it
getting the loop to run through correctly? Is it some other problem?

Tim

> 
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list