How to Change Value of a List Specific Item in Python


In this example, we will learn how to change the value of a list specific item in Python.

Source Code

my_list = ['a', 'b', 'c', 'd', 'e']
my_list[2] = 'f'
print(my_list)

Output:

['a', 'b', 'f', 'd', 'e']
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments