Advertisement
rfmonk

itertools_cycle.py

Jan 16th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. from itertools import *
  5.  
  6. for i, item in izip(xrange(7), cycle(['a', 'b', 'c'])):
  7.     print (i, item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement