zip函数,一一对应组成元组,不是一一对应的都不要,像拉链一样
>>> list(zip(('a','b','c'),(1,2,3)))
[('a', 1), ('b', 2), ('c', 3)]
>>> list(zip(('a','b','c','d'),(1,2,3)))
[('a', 1), ('b', 2), ('c', 3)]
>>> list(zip(('a','b','c'),(1,2,3,4)))
[('a', 1), ('b', 2), ('c', 3)]
>>> p = {"name":"xiaoming","age":18,"gender":"men"}
>>> list(zip(p.keys(),p.values()))
[('age', 18), ('gender', 'men'), ('name', 'xiaoming')]
>>>