2.3 Lists
If we could only write down numbers and strings, Python would not be a practical programming environment. Of course, we want to do things to numbers such as add them, multiply them, and use them to count things. For strings, we’d like to search and construct text we display to our users.
More than that, we need ways to hold collections of data together. If I had three children, I could hold their ages together as a list:
[12, 16, 19]
[12, 16, 19]
and use another list for their names:
["Robin", "Robert", "Roberta"]
['Robin', 'Robert', 'Roberta']
I could put the names and ages in the same list:
["Robin", 12, "Robert", 16, "Roberta", 19]
['Robin', 12, 'Robert', 16, 'Roberta', 19]
Square brackets “[” and “]” delimit the items...