Alternate

Alternate#

Define a function alternate that takes two lists and returns a list alternating their elements, e.g., alternate([x1,x2,x3], [y1,y2,y3,y4,y5]) should return [x1, y1, x2, y2, x3, y3, y4, y5]. Note that if one list is longer than the other, we just return what’s left of the longer list.