fork download
  1. #!/usr/bin/env python
  2.  
  3. from itertools import count, islice
  4.  
  5. num = filter(lambda x: all([x % m != 0 for m in (2, 3)]), count(2))
  6.  
  7. if __name__ == '__main__':
  8. print(list(islice(num, 0, 6)))
  9.  
  10.  
Success #stdin #stdout 0.11s 13940KB
stdin
Standard input is empty
stdout
[5, 7, 11, 13, 17, 19]