擅长:python、mysql、java
<pre><code>myList = ['2', '', '9', '24', '1', '7', '12', '4', '', '18', '13', '34', '3', '10']
newList = []
tmp = []
for item in myList:
if item:
tmp.append(item)
else:
newList.append(tmp)
tmp = []
newList.append(tmp) # may need to wrap this in an
# "if tmp != []" thingy
</code></pre>