build_records(ids, names, scores) that uses zip() to combine three parallel lists into a list of 3-tuples (id, name, score) — returning the tuples themselves (not formatted strings), stopping at the shortest input list.build_records([1, 2], ['A', 'B'], [90, 85])
[(1, 'A', 90), (2, 'B', 85)]
zip() pairs elements positionally into tuples.
build_records([1, 2, 3], ['A'], [90, 85])
[(1, 'A', 90)]
zip() stops at the shortest list.
list(zip(ids, names, scores)) directly produces a list of 3-tuples.