Question: 6) Write a function allbut(a_list, index), which takes as arguments a list and an index, and returns a new list with all elements of
6) Write a function allbut(a_list, index), which takes as arguments a list and an index, and returns a new list with all elements of the argument list (in the order they were) except for the element at index. The argument list should not be modified by the function. my_list=[1,2,3,4,5,6] my_short_list allbut(my_list, 3) print(my_short_list) print(my_list) # [1, 2, 3, 5, 6] #[1, 2, 3, 4, 5, 6]
Step by Step Solution
3.46 Rating (159 Votes )
There are 3 Steps involved in it
The task at hand involves writing a Python function called allbut al... View full answer
Get step-by-step solutions from verified subject matter experts
