File "C:\Python23\Prime Number.py", line 8, in -toplevel- >> q=x%y > An infinite loop is probably not a good idea either. :-) Why should it not be a good idea? Are there any ideas that the number of primes is limited? :-) Harald