Utilizor
Contact Us

Python Lists

Ordered, changeable collection.

Examples

Access List Items

Prints 'banana'.

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

Change Item Value

Changes 'banana' to 'blackcurrant'.

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

Add Items

Adds 'orange' to the end.

thislist = ["apple", "banana", "cherry"]
thislist.append("orange")
print(thislist)

Test Your Knowledge

Python Quiz

No quiz available for this topic yet.