Module 5

Changing lists

Lists can be modified.

Lists are mutable

Unlike strings, lists can be changed. You can assign a new value to any position.

Python
samples = ["control", "treatment", "blank"]
samples[2] = "reference"
print(samples)
['control', 'treatment', 'reference']
Your task

Change a list

  • Change the third element to reference.