I have a number lets make it a list s = [1,6,**9**,2,3,2,7,3,6,8,4,1,9,0,0,3,6,8]

and I have k = 4

What I want is to replace 4-values of list s with number 9 which dont have number 9.

means at position 2 ,we have 9,so skip that and replace next one.

Output should be like: [**9,9**,9,**9,9**,2,7,3,6,8,4,1,9,0,0,3,6,8]

With this code I am unable to skip 9's in it:

```
x= [1,6,9,2,3,2,7,3,6,8,4,1,9,0,0,3,6,8]
k = 4
def elements_replaced(lst, new_element, indices):
    return [new_element if i in indices else e for i, e in enumerate(lst)]

output = elements_replaced(x,9,range(k))
print output

```