Nicely done! We already know some basic data types—integers, floats, and strings. Now, we want to perform some analyses on multiple values (e.g. Canada's 10 most populous cities). You could start with something like this:
city_1 = 'Toronto'
city_2 = 'Montreal'
city_3 = 'Vancouver'
But that's a lot of typing. Besides, it's difficult to handle groups of data stored in this way. Python offers a few ways to store multiple values in a single variable. The most versatile one is called a list. Take a look:
canadian_cities = [
'Toronto', 'Montreal', 'Calgary',
'Ottawa', 'Edmonton', 'Mississauga',
'Winnipeg', 'Vancouver', 'Brampton', 'Familton' ]
A list is created by putting its elements inside square brackets, separated by commas. Because our elements are strings, we also needed to surround them with single (
'') or dobule (