python script to give a list of prime no.

Chris Angelico rosuav at gmail.com
Sun Apr 5 08:41:00 EDT 2020


On Sun, Apr 5, 2020 at 10:35 PM Orges Leka <orges.leka at gmail.com> wrote:
>
> You can try the following:
> It is based on trial division and very slow, compared to the state of the
> art:
>

I think it's more helpful to assist the OP in learning coding, rather
than provide a completely different function to do a similar purpose
:) I strongly suspect that the OP is doing this prime number finder as
part of learning Python, not as a means of actually finding prime
numbers.

BTW, you may want to be careful of mixing floats and ints. It's
generally safest to stick to just integers - fewer things to have to
think about.

ChrisA


More information about the Python-list mailing list