logo-MindMajix
PostPythonPython
n
naveen nani

Posted on 23rd June 2024|14 views

0
votes

Replace Element In List Python

How to replace elements of a list in python?

1 answers
Answers
P
naseer mohammad

Posted on 23rd June 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]

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number