I was wondering if anyone new how to do this question in python? 
Write a function that takes in both a list (myList) and a value (n) and checks whether or not the value is in that list. If the value does exist in the list replace it with the value “1”. Your function should return the updated list. Use function signature: def replaceNum(myList, n):

Example: If the input to the function were replaceNum([12, 6, 10, 10], 10), the function would return a list with [12, 6, 1, 1].

I have this so far

```
def replaceNum(myList,n):
    new_list = []
    for i in range(0, len(myList)):
        if i == n:
            myList[n] = 1
            new_list.append(i)

        return myList[i]
print(replaceNum([5, 10, 20], 10))

```

but it only prints a 5 and I need it to print [5,1,20]