标签: python
我想使用迭代器创建一个列表,该列表将达到100,000
['guid:0','guid:2',.....'guid:100000']
Python是最常用的python方法吗?一个班轮......
答案 0 :(得分:3)
python2:['guid:%d' % i for i in xrange(0, 100002, 2)]
['guid:%d' % i for i in xrange(0, 100002, 2)]
python3:['guid:%d' % i for i in range(0, 100002, 2)]
['guid:%d' % i for i in range(0, 100002, 2)]