I got this code:
def update(ll, n, v):
[ll, n, v][1] = v
return [ll, n, v]
m = [1, 2, 3, 4]
m = update(m, 2, 'new')
print(m)
What I want to do is replace n with the information v, so the list print should say:
[[1, 2, 3, 4], 'new', 'new']
I found out that you could replace element in list with [ll, n, v][1] = v but it doesn’t seem to work.