How do you create a list of the first four prime numbers?
primes = [2, 3, 5, 7]
Create a list of lists with products (A, B, C,…) on 3 shelves
products = [ [A, B, C] [D, E, F] G, H, I] ]
Can a list contain multiple variable types?
Yes
For list of planets, how would you change the first one to Manchester?
planets[0] = ‘Manchester’
How would you change the last planet to London?
planets[-1] = 'London'
How do you access the first 4 planets of the list?
planets[0:5]
Can you modify lists? What word is used to describe this?
Yes, they are mutable
A function attached to an object is called a ——-
method
How do you add Birmingham to the end of the list of planets
planets.append(‘Birmingham’)
How does a tuple differ from a list?