We’ve seen that the items in a list can be numbers or strings. They can also be other lists!
Once more, let’s return to our class height example:
Previously, we saw that we could create a list representing both Jenny’s name and height:
jenny = ['Jenny', 61]
We can put several of these lists into one list, such that each entry in the list represents a student and their height:
heights = [['Jenny', 61], ['Alexus', 70], ['Sam', 67], ['Grace', 64]]
A new student named
'Vik' has joined our class. Vik is
68 inches tall. Add a sublist to
heights that represents Vik and his height.
Create a list of lists called
ages where each sublist contains a student’s name and their age. Use the following data: