Back to Module 3

Lists

A list is an ordered, mutable collection.

platforms = ["Windows", "Mac", "Linux"]

Indexing and slicing

print(platforms[1])
print(platforms[1:])

Concatenation

numbers = [1, 2, 3]
combined = platforms + numbers
print(combined)

Mutability

platforms.append("Android")
print(platforms)

platforms[0] = "FreeBSD"
print(platforms)

Next: Conditional statements