Quantcast
Channel: Fastest-in term of space- way to find prime numbers with python - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Fastest-in term of space- way to find prime numbers with python

$
0
0

Maybe it is a stupid question, but i was wondering if you could provide the shortest source to find prime numbers with Python.I was also wondering how to find prime numbers by using map() or filter() functions.Thank you (:

EDIT: When i say fastest/shortest I mean the way with the less characters/words. Do not consider a competition, anyway: i was wondering if it was possible a one line source, without removing indentation always used with for cycles.EDIT 2:The problem was not thought for huge numbers. I think we can stay under a million( range(2,1000000)EDIT 3: Shortest, but still elegant. As i said in the first EDIT, you don't need to reduce variables' names to single letters. I just need a one line, elegant source.Thank you!


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images