πŸ”’ Lists

✍ Datatypes so far…

✍ Lists

Datatype used to store a collection of different pieces of information, in order, under a single variable name.

numbers = [5, 6, 7, 8]
#  index   0  1  2  3

List Practice

numbers = [5, 6, 7, 8]
#  index   0  1  2  3

# What will print?
do_now = ["words", "stuff", "wrong", "this", "right", "question", "got", "you"]
print do_now[7] + do_now[6] + do_now[3] + do_now[2]

Putting Things Into a List

suitcase = []
print suitcase
suitcase.append("sunglasses")
print suitcase

What does .append() do?