JavaScript
x
12
12
1
def combine_lists(list1, list2):
2
# Generate a new list containing the elements of list2
3
# Followed by the elements of list1 in reverse order
4
list3=list2.extend(list1.reverse())
5
return list3
6
7
8
Jamies_list = ["Alice", "Cindy", "Bobby", "Jan", "Peter"]
9
Drews_list = ["Mike", "Carol", "Greg", "Marcia"]
10
11
print(combine_lists(Jamies_list, Drews_list))
12
Advertisement
Answer
See if this is what you are looking for :
JavaScript
1
6
1
>>> Jamies_list = ["Alice", "Cindy", "Bobby", "Jan", "Peter"]
2
>>> Drews_list = ["Mike", "Carol", "Greg", "Marcia"]
3
>>>
4
>>> Drews_list + Jamies_list[::-1]
5
['Mike', 'Carol', 'Greg', 'Marcia', 'Peter', 'Jan', 'Bobby', 'Cindy', 'Alice']
6