Fred Agbo
October 14, 2026
HUsTv1
If there’s a single most important thing to do to help you improve in content understanding and grades in this class what would that be?
Created using square brackets with elements separated by commas:
COIN_VALUES = [1, 5, 10, 25, 50, 100]
COIN_NAMES = [ "penny", "nickle", "dime",
"quarter", "half-dollar", "dollar" ]Lists are commonly represented visually or conceptually as a series of numbered boxes:
Can retrieve the value of any element in a list by writing the index of that element in square brackets after the list name
COIN_VALUES[3] ⟶
25COIN_NAMES[2] ⟶
"dime"Can concatenate two lists to form a new list with elements from both
[1,2,3] + [4,5,6]⟶
[1,2,3,4,5,6]Can loop through each of the list elements in turn
for elem in my_list:
# do stuff with elem
where elem is the name of the variable
that will sequentially get assigned the value of every element in
my_list
len function+ or
+=*in operatorWhat would the below expression evaluate to?
["One", 2, True][-1:1:-1][1]
"n"2TrueWhat would the below expression evaluate to? Or would it error out?
['One', 2, True][-1:1:-1][0]
This is a coding problem, work in pairs or trios on a single computer
In manifest.py, I’ve created a list
of passenger information for an airline
The list has passenger information in a “name”, “age”, “seat” ordering
So, for example, the first few passengers look like:
MANIFEST = [
"Anthony Hutchinson", 77, "24A",
"Carol Turner", 37, "8F",
...etc...
]Prob2.py, you can add your codeis_seat_available
to check to see if a particular seat is available (not currently
assigned)avg_age_window_seats, which returns the
average age of all passengers riding in a window seat (“A” and “F”
seats)