Replacing last element of a list
Replace the last element of the given list with the given second parameter. Return an updated list.
Sample Code:
def replaceEle(l,i):
# Enter your logic here...
Examples:
Input: [1,2,3],[3.1]
Output: [1,2,[3.1]]
Explanation: The last element 3 has been replaced by [3.1].
Input: ['c','o','d','?'],'e'
Output: ['c','o','d','e']
Explanation: The last element '?' has been replaced by 'e'.