|
|
#2
liufashuai2013-08-12 16:33
|
程序代码:def flatten(nested):
try:
for sublist in nested:
for element in flatten(sublist):
yield element
except TypeError:
yield nested
try:
for sublist in nested:
for element in flatten(sublist):
yield element
except TypeError:
yield nested