LEATH
这应该做到这一点:d[key] = [(x, y[0]) for x,y in d[key]]简单版本:new_val = []for x, y in d[key]: #In each iteraion x is assigned to VALs and `y` is assigned to (Flag1, Flag2) #now append a new value, a tuple containg x and y[0](first item from that tuple) new_val.append((x, y[0]))d[key] = new_val #reassign the new list to d[key]修改整个字典:dic = { k: [(x, y[0]) for x,y in v] for k,v in dic.items()}在py2.x中,您可以使用dic.iteritems它,因为它返回一个迭代器,dic.items()将在py2x和py3x上都可以使用。