In 198 from itertools import count In 199 def foo while for in count i

1
2
3
4
5
6
7
8
9
In [198]: from itertools import count
In [199]: def foo(x):
.....: while x != 1:
.....: for k in count(2):
.....: if x % k == 0:
.....: x /= k
.....: yield k
.....: break