

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Functions As Values
incomplete
2: Anonymous Functions
incomplete
3: First-Class and Higher-Order Functions
incomplete
4: Map
incomplete
5: Filter
incomplete
6: Reduce
incomplete
7: Map, Filter, and Reduce Review
incomplete
8: Zip
incomplete
9: Higher-Order Functions Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
The zip function takes two iterables (often lists), and returns a new iterable where each element is a tuple containing one element from each of the original iterables.
a: list[int] = [1, 2, 3]
b: list[int] = [4, 5, 6]
c: list[tuple[int, int]] = list(zip(a, b))
print(c)
# [(1, 4), (2, 5), (3, 6)]
Complete the pair_document_with_format function. It takes two lists of strings as input:
doc_names: the names of documentsdoc_formats: the file formats of the documents