Simple numeric list
Input
consecutive_pairs([10, 20, 30])
Output
[(10, 20), (20, 30)]
Pairs are (10,20) and (20,30).
Full lesson preview
Use zip to build consecutive pairs from a sequence. Practice slicing and pairing adjacent elements efficiently.
Problem statement
Task
Examples
Input
consecutive_pairs([10, 20, 30])
Output
[(10, 20), (20, 30)]
Pairs are (10,20) and (20,30).
Input format
Output format
Constraints
Samples
Input
consecutive_pairs(['a', 'b', 'c'])
Output
[('a', 'b'), ('b', 'c')]
Consecutive string pairs from the list.