Python Program to Change Element of a List



In this example we will learn how to change the element of List



  1. #Change element of a specific index in a list
  2. list = ['1', '2', '3', '4', '5']
  3. print(list)
  4. #Let's Change element of index 2 to '9'
  5. list[2] = '9'
  6. #Now print the new list
  7. print(list)

Output


Output!