Python list: How can I replace certain items of the list?
In this tutorial, you will learn how to replace certain items of the list?
for n, i in enumerate(b):
if i == 1:
b[n] = 10
[10, 2, 3, 4, 5, 6, 7, 8]
If you have any alternative ways to do it, You can comment below.