Python 修改列表项

修改项的值

要更改特定项的值,请引用索引号:

实例

更改第二项:

thislist = ["apple", "banana", "cherry"]
thislist[1] = "blackcurrant"
print(thislist)

亲自试一试