Question: Write a function triples of type [ ( a , b ) ] - > [ ( a , b , a ) ] that

Write a function triples of type [(a, b)]->[(a, b, a)] that takes a list of pairs, and returns a list of triplets, formed by repeating the first element of the pair.. For example, the expression triples [(9, True),(7, True),(5, False)] would evaluate to [(9, True, 9),(7, True, 7),(5, False, 5)1. Turn in a listing of your function, and the results of this test case.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!