Posted on 16th September 2024|14 views
How to replace elements of a list in python?
Posted on 16th September 2024| views
You can replace the elements of a list very easily like this
Assume you have a list of numbers
numbers = [1, 1, 3, 4, 5]
numbers[2] = 2
Output:
numbers = [1, 2, 3, 4, 5]