Question: (d) Write a function: def split (self, i) 1, that changes the list (the one represented by self) by removing from it all elements from

(d) Write a function: def split (self, i) 1, that changes the list (the one represented by self) by removing from it all elements from position i on, and returns a new list containing exactly those elements in the same order). You can assume that i is between 0 and the lenghth of the list. For example, if ls is the list [4,5,6,7,8] then ls.split(3) should change is to [4,5,6] and return the list [7,8]. On the other hand, ls.split(5) should leave ls unchanged and return the empty list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
