擅长:python、mysql、java
<p>尝试以下操作:</p>
<pre><code>data = [(107, u'Ella', u'Fitzgerald'), (108, u'Louis', u'Armstrong'), (109, u'Miles', u'Davis'), (110, u'Benny', u'Goodman')]
for record in data:
print '{0:}, {1:}, {2:}'.format(*record)
# or in case you want to get a dictionary
d = dict([(x[0], ', '.join(x[1:])) for x in a])# sure that you can skip merging name and surname here(just replace join with x[1:])
for k, v in d.iteritems():
print '%s, %s' % (k, v)
>>>107 Ella, Fitzgerald
>>>108 Louis, Armstrong
>>>109 Miles, Davis
>>>110 Benny, Goodman
</code></pre>