(lst)
| 126 | #prime numbers in a lazy list. |
| 127 | @lazylist |
| 128 | def primegen(lst): |
| 129 | yield 2 |
| 130 | for candidate in itertools.count(3): #start at next number after 2 |
| 131 | #if candidate is not divisible by any smaller prime numbers, |
| 132 | #it is a prime. |
| 133 | if all(candidate % p for p in lst.computed()): |
| 134 | yield candidate |
| 135 | primes = primegen() #same for primes- treat it like an infinitely long list |
| 136 | #containing all prime numbers. |
| 137 | print(fibs[0], fibs[1], fibs[2], primes[0], primes[1], primes[2]) |
no test coverage detected