Writing a remove function that removes an item at a certain index and returns that list while returning the original list without the remove item. I am not sure why but when returning the new list and original list, the values are identical.
def remove(my_list, index: int):
new_list = my_list
new_list.remove(new_list[index])
return new_list, my_list
my_list = ['a', 'b', 'c']
print(remove(my_list, 1)
My output is (['a', 'b', 'd'], ['a', 'b', 'd'])
What I am trying to get is (['a', 'b', 'd'], ['a', 'b', 'c', 'd'])