擅长:python、mysql、java
<p>循环法是一种更好的方法,但您也可以使用<a href="https://docs.python.org/2/library/itertools.html#itertools.chain" rel="nofollow">chain</a><a href="https://docs.python.org/2/library/itertools.html#itertools.izip_longest" rel="nofollow">izip_longest</a>和{a3}:</p>
<pre><code>from itertools import chain, izip_longest, ifilterfalse
for x in ifilterfalse(lambda x: x is None,chain.from_iterable(izip_longest(*cycleList))):
print x,
0 0 0 1 1 1 2 2 2 3 3 3 4 4 4 5 5 6 6 7 7 8 8 9 9 10 11 12 13 14
</code></pre>
<p>如果没有值,请使用对象:</p>
^{pr2}$