[Solved] List elements to equal zero after 0 element


to add another options to all these good answers, another one with lambda:

l = [4,3,3,2,1,0,1,2]
f= lambda x,i : 0 if 0 in x[:i] else x[i]
[f(l,i) for i in range(len(l))]

output:

[4, 3, 3, 2, 1, 0, 0, 0]

1

solved List elements to equal zero after 0 element