zip() zips together the sequences, returning a list of tuples: : zip « Buildin Function « Python Tutorial






names = ['A', 'B', 'C', 'D'] 
ages = [12, 45, 32, 102] 
print zip(names, ages)








13.49.zip
13.49.1.zip() zips together the sequences, returning a list of tuples:
13.49.2.Use zip function in for loop
13.49.3.zip() stops when the shortest sequence is "used up" for different lengths
13.49.4.enumerate() and zip()
13.49.5.zip to a dictionary