I want to change a part of a list and save the result. I would like to know why this method is not working. And Thank you!
Code:
def Test(L):
for i in range(len(L)):
L[i] = L[i][1:]
L = ["-stackoverflow", "-Python", "-C++"]
Test(L[1:])
print(L)
Ouput:
['-stackoverflow', '-Python', '-C++']
Expected:
['-stackoverflow', 'Python', 'C++']