How do I change a number in a list without knowing the position the number is in? For example, if I had:
numbers = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10]
Say I wanted to change the number 11 to 1 and I do not know that 11 is in position 0.
I do not want to do something like,
if 11 in numbers:
number[11] = 1
because this would change number 10 to 1. So, no matter where the 11 is in the list, it will replace it with a 1.
The code above is basically checking if there is an 11 in the list and if there is, it will replace it with 1.