Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python 3- given the lists list1 and list2, not necessarily of the same length, c

ID: 648347 • Letter: P

Question

Python 3- given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of list1 and list2 the remaining elements of the longer list is added to the end of the new list Python 3- given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of list1 and list2 the remaining elements of the longer list is added to the end of the new list Python 3- given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of list1 and list2 the remaining elements of the longer list is added to the end of the new list

Explanation / Answer

>>list1=[2,4,6,8];list2=[1,3,5,7];
>>list3=list1+list2;
list3=
   3   7   11   15
% create a new list

>> list1.extends(list2);
% extends a list

>>list(merge(list1,list2))
Ans
   1   2   3   4   5   6   7

% merge sort the lists.