Could someone please tell me what I\'m doing wrong with this code? It is just printing \'count\' anyway. I just want a very simple prime generator (nothing fancy).
re is powerful:
import re def isprime(n): return re.compile(r'^1?$|^(11+)\1+$').match('1' * n) is None print [x for x in range(100) if isprime(x)] ###########Output############# [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]