Strings
Tuples
Lists
Dictionaries
Misc
100

For the string s = "mango", this is the value returned by the expression s[4].

What is "o"?

100

This character separates the elements of a tuple. 

What is a comma?

100

The type of brackets used to define and instantiate a list in Python.

What are square brackets []?

100

What you use to access a value in a dictionary.

What is a key?

100

This property is shared by both lists and dictionaries, allowing their contents to be changed after creation.

What is mutability?

200

The Python string method you would use on the string "  hello  " to remove all leading and trailing blank spaces.

What is .strip()?

200

This is the specific property of a tuple that prevents you from changing an element, such as

t = ("Apples", 15, "Sunrise")

t[2] = "sunset"

What is immutability?

200

The method you would use to add the single element 21 to the end of the list lFavourites.

What is .append(21)?

200

The value you would get if you attempted to access a non-existent key using the .get() method?

What is None?

200

The Python keyword used to check if a specific key exists within a collection.

What is in?

300

What is the index of the character 's' in the string "strawberry"?

What is 0?

300

The term for when multiple variables are assigned at once from a tuple, like in 

sTypeOfDessert, sFlavour = tDessert.

What is unpacking (or tuple assignment)?

300

This is the value of 

list_1 = [1, 2] 

list_2 = [3, 4] 

new_list = list_1 + list_2

What is [1, 2, 3, 4]?

300

The method used to add or change multiple key-value pairs in a dictionary at once.

What is .update()?

300

This specific type of error occurs if you try to use my_list[5] when my_list only has 4 elements.

What is an IndexError?

400

This is the result of the expression 'eggs, bananas, bread'.split(', ')[1]

What is "bananas"?

400

This is the resulting value printed from 

tDessert = ("Cake", "Vanilla")

print(tDessert[0])

What is "Cake"?

400

The output of this expression

my_list = ['hello', 2, ['one', 2, 'three'], ('cake', 'chocolate'), True]

print(len(my_list))

What is 5?

400

The expression you would use to remove the key-value pair for "Manitoba" from the dCapitalCities dictionary.

dCapitalCities = {"Manitoba": "Winnipeg", "Alberta": "Edmonton", "Ontario": "Ottawa", "BC": "Victoria"}

 

What is del dCapitalCities["Manitoba"]?

400

The method you would call on a list of numbers to find the element with the largest value.

What is .max()?

500

This is the output of s = "strawberry"; print(s[-3:]).

What is "rry"?

500

This is the value printed by the expression 

tExRaptors = ( ("Lowry", "76ers", 3.9), ("Siakam", "Knicks", 20.2) )

print(tExRaptors[1][0])

What is "Siakam"?

500

This is the output of

my_list =  ['a', 'b', ['a', 'c'], 'a']

print(my_list.count('a'))

What is 2?

500

The expression to retrieve the population of British Columbia from this dictionary

CanadianProvinces = {"AB": {"name": "Alberta", "capital": "Edmonton", "population": 4413146}, 

"BC": {"name": "British Columbia", "capital": "Victoria", "population": 5231001},

"MB": {"name": "Manitoba", "capital": "Winnipeg", "population": 1379263}}

What is CanadianProvinces["BC"]["population"]?

500

In the list of dictionaries dCars, this expression is used to access the Model of the first car. 

dCars = [{"Make": "Toyota", "Model": "RAV4", "Year":2010, "Colour": "Blue"}, 

{"Make": "Nissan", "Model": "Micra", "Year":2019, "Colour":"Teal"}, 

{"Make": "Subaru", "Model": "Impreza", "Year": 2015, "Colour":"Grey"}

]

What is dCars[0]["Model"]?