December 2018
Beginner to intermediate
796 pages
19h 54m
English
We've already covered zip in the previous chapters, so let's just define it properly and then I want to show you how you could combine it with map.
According to the Python documentation:
Let's see an example:
# zip.grades.py>>> grades = [18, 23, 30, 27]>>> avgs = [22, 21, 29, 24]>>> _(zip(avgs, grades))[(22, 18), (21, 23), (29, 30), (24, 27)]>>> _(map(lambda *a: a, avgs, grades)) # equivalent to zip[(22, 18), (21, ...
Read now
Unlock full access