I have to create a code(function) that moves elements in a list without using temporary list and the function has to return nothing, I've tried the following but It won't work please help
def move_zeros_v2(lst):left = []right = []left_a = left.appendright_a = right.appendfor x in lst:if x:left_a(x)else:right_a(x)left.extend(right)i = 0while i < len(left):lst[i] = left[i]i = i + 1x = [1, 0, 3, 0, 0, 5, 7]
z=move_zeros_v2(x)
print(x, z)