Infinite range in my python prime finder?

primes, python

Solution

You can import itertools and use `count` function

import itertools
for num in itertools.count(1):
    print num

count(1) --> 1 2 3 4 5 ...

count(10) --> 10 11 12 13 14 ...

count(1, 2) --> 1 3 5 7 9 ...

The first argument is the starting point.

Problem

I am trying to get an infinite range in my python prime number finder! here is my code! ``` import math print "Welcome to Prime Finder!" option = raw_input("continue(y/n)") if option == "y": for num in range(1,(infinite number)): if all(num%i!=0 for i in range(2,int(math.sqrt(num))+1)): print num ``` I am trying to get where it says (infinite number) to actually be an infinite number. Is there some value or something that I can use to find that? Any help would be greatly appreciated!

Original source

Related problems