Python Change List Item
Change Item Value
To change the value of a specific item, refer to the index number:Example
Change the second item:
thislist = ["apple", "banana", "cherry"]
thislist[1] = "blackcurrant"
print(thislist)
Try it Yourself »
thislist[1] = "blackcurrant"
print(thislist)
Related Pages
Python Lists Tutorial Lists Access List Items Loop List Items List Comprehension Check If List Item Exists List Length Add List Items Remove List Items Copy a List Join Two Lists