Tuples
Lists
Lists with For Loops
List Methods
Misc.
100

In Python, tuples are enclosed in these types of brackets.

What are parentheses? ()

100

In Python, this line of code is used to create an empty list named myList.

What is "myList = []" ?
100

What does this code do?

for num in range(5):

    print(num)

It prints the numbers 0 through 4.

100

If you want to add an item to the end of a list called my_list, you would use this method.

What is append()?

100

This is the method that turns String 

str = "I like pizza" 

into the list 

my_list =  ["I", "like", "pizza"]

What is 

my_list = str.split()

?

200

This is a term in Computer Science that means that its elements cannot be changed after creation.

What is "immutable"?

200

Given the list my_list = [1, 2, 3], what will my_list[2] return?

What is 3?

200

This is the built-in Python function that can help you print the index and value of each item in a list using a for loop. 

What is enumerate()?

200

This method is used to add all elements of one list to the end of another list.

 What is extend()?

200

Given my_list = [ "eggs", "butter", "milk", "cheese"], 

This is the output of 

print ( my_list[-1] )

What is 

cheese

?

300

Given the tuple t = (1, 2, 3), what will t[1] return?

What is 2?

300

Given the list my_list = [10, 20, 30], what would my_list[1:2] return?

What is [20]? (List from index 1 to 2, exclusive of 2.  MUST INCLUDE BRACKETS OR INCORRECT)

300

Given the list numbers = [1, 2, 3, 4], how can you print each element using a regular for loop (without using "for i in range(x)"?

What is: 

for num in numbers:

    print(num)

300

This method deletes the first occurrence of a specified element from a list. If the element is not found, it raises a ValueError.

What is remove()?

300

This is the code you would want to write to get the number of Strings "jake" in the list 

my_list = [ "jake", "finn", "jake", "BMO", "jake"]

What is 

my_list.count("jake")

?

400

This is the ouput after the following code: 

tup = (1, 2, 3)

tup[0] = 5

print(tup)

What is "No ouput. This operation will throw an error since we cannot modify an element of a tuple.

400

This list contains another list as one of its elements: list = [1, 2, [3, 4], 5]. To access the number 4, you would use this index.

What is list[2][1]?

400

Given the list numbers = [10, 20, 30], what will the following print?

for i, value in enumerate(numbers):

    print(i, value)

This will print:

0 10

1 20

2 30

400

This is value of myList after the following:

myList = [7, a, 4, C]

myList = sort(myList)

What is " [4, 7, C, a] " ?

400

What will print given the below code? 

my_list = [ "jump", "skip", "run"]

my_string = " then ".join(my_list)

my_new_list = my_string.split()

print (my_new_list)

What is

 [ "jump", "then", "skip", "then", "run"]

500

This is how I would print the String "def" from the below tuple:

my_tuple = ( 1, 2, 3, ( "abc", "def",  "ghi"), 4, 5)

What is " print my_tuple[3][1] "?

500

Given a list " my_list = ["Alina", "Bach", "Chen"] ", this is how you would turn this into a String "Alina and Bach and Chen" named "my_string" using a single method. 

What is 

my_string = " and ".join(my_list)

***Note the spaces on both sides of "and"!***

500

***BONUS DAILY DOUBLE - Worth an extra $500*** 

Given list_of_lists = [[1, 2], [3, 4], [5, 6]], this nested for loop would print each element one at a time.


What is:

for row in list_of_lists:    

       for item in row:        

                print(item)


500

This is how we transform the String 

my_String = "apples bananas cranberries" 

into the list my_list containing ["apples", "bananas", "cranberries"]

What is

my_list = list( my_String) 

500

An iconic figure in the world of fashion, this French designer founded a renowned luxury brand that bears his name.

Who is Coco Chanel?

M
e
n
u