Guest User

Untitled

a guest
Nov 14th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. generateSequence(1) { it + 1 }.take(5).forEach { println(it) }
  2.  
  3. def count(x):
  4. while True:
  5. yield x
  6. x += 1
  7.  
  8. for i in count(5):
  9. print(i)
  10.  
  11. import itertools
  12. for i in itertools.count(5):
  13. print(i)
Add Comment
Please, Sign In to add comment