拉链函数接受两个可遍历对象参数,一一对应
print(list(zip('hello', '12345')))
# [('h', '1'), ('e', '2'), ('l', '3'), ('l', '4'), ('o', '5')]
print(list(zip(['alex', 'momo'], 'hi')))
# [('alex', 'h'), ('momo', 'i')]
dic = {'momo_age': 18, 'lili_age': 22}
print(list(zip(dic.keys(), dic.values())))
# [('momo_age', 18), ('lili_age', 22)]
print(list(zip([1, 2, 3, 4], ['dog', 'cat', 'monkey', 'pig', 'tiger'])))
# [(1, 'dog'), (2, 'cat'), (3, 'monkey'), (4, 'pig')]