Ray's playground

 

Recipe 19.2. Building a List from Any Iterable

1 >>> import itertools
2 >>> a=[1,2,3]
3 >>> b=itertools.islice(a, 12)
4 >>> for i in b:
5     print(i)

Output: 2

 

 

posted on 2009-10-30 23:06  Ray Z  阅读(183)  评论(0编辑  收藏  举报

导航