| CMSC 201 |
Lab 5: LoopsListsWhat are they? A list is a collection of items that can be referenced by the same name.
How do I use them? In python, this is how you initialize lists! list1 = []#A new empty list list2 = [1, 2, 3, "jello"]#A new non-empty list How to access each element in a list? Use indexes!
list2 = [1, 2, 3, "jello"] print(list2[3]) |