Post
Python
Posted on 24th April 2024|13 views
How to replace elements of a list in python?
Posted on 24th April 2024
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]
STILL GOT QUERIES?