标签: python
如上所述。 示例:
a = [('P', 2), ('J, 3'), ('K', 3)]
必填: b = ['P','J','K'] 并且c = [2,3,3]
答案 0 :(得分:3)
尝试一下:
b, c = zip(*the_thing)
示例:
>>> b, c = zip(*[('P', 2), ('J', 3), ('K', 3)]) >>> b ('P', 'J', 'K') >>> c (2, 3, 3)