A. Introduction
If you want to poll everyone's favorite Christmas activities, how will you store the responses?
You can store them in a list.
B. Notes
List items are ordered, changeable, and allow duplicate values, unlike sets.
List items are also indexed, the first item has index [0], the second item has index [1], etc.
For example,
$ list1 = ["apple", "banana", "cherry"]
$ list2 = [1, 5, 7, 9, 3]
$ list3 = [True, False, False]
$ print(list1[1])
"banana"
$ print(list2[0])
1
$ print(list3[2])
False
$ print(list3[3])
IndexError: list index out of range
$ activities = ['snowball fight', 'sledding', 'skiing', 'caroling', 'sledding', 'caroling', 'sledding']
C. Try this:
Given a list of numbers, find and print all its elements with even indices (i.e. A[0], A[2], A[4], ...).
Given a list of numbers with all elements sorted in ascending order, determine and print the number of distinct elements in it.
Given a list of your friends' favorite Christmas activities (see above), iterate through the list to determine which activity is the most popular.