Numbers pairing
Input
pair_elements([1,2], [3,4])
Output
[(1, 3), (2, 4)]
Elements at matching positions are paired.
Full lesson preview
Combine two sequences element-wise into pairs using zip.
Problem statement
Task
Examples
Input
pair_elements([1,2], [3,4])
Output
[(1, 3), (2, 4)]
Elements at matching positions are paired.
Input format
Output format
Constraints
Samples
Input
pair_elements([1,2,3], [4,5])
Output
[(1, 4), (2, 5)]
Stops when the second iterable is exhausted.