Worksheets2D Lists and Arrays
Total questions: 15
Worksheet time: 8mins
Is this a List or an Array?
I can store multiple values of different data types
List
Array
Is this a List or an Array?
Once made it's impossible to change the number of elements I store.
List
Array
Is this a List or an Array?
I cannot store values of different data types. I can only store multiple pieces of data when they are the same data type.
List
Array
Is this a List or an Array?
I am an infinite data structure - I can take many additional values once I've been created.
So you can add as many elements to me as you want.
List
Array
What is the number of the index of the first value in a list?
0
1
2
start
An index is ...
A number given to each value in a list to show it's position in the list.
A number assigned to every value in the list to say how many characters it contains.
A number assigned to every list.
A letter given to each value in a list to show it's position in the list.
Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]
How many rows are in the 2D list above?
0
1
2
3
Fruits = ["Apple","Pear","Orange","Grape","Pineapple",'Pen"]
What will be displayed if I type in:
print(Fruits[2])
Orange
Apple
Pear
Grape
Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]
How many columns are in the 2D list above?
0
1
2
3
Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]
What is the element in Fruits[2][1]?
Grape
Pineapple
Nothing, It doesn't exist
Orange
When talking about lists, what does append mean?
Add a value to the end of a list
Add a value to the begining of a list
Add the word pen to a list
Print out the list
What does this line of code do?
Fruits.reverse()
Reverse the order of a list
Put a list into alphabetical order
Put a list into numerical order
Doesn't do anything a list
What does this line of code do?
Fruits.sort()
Reverse the order of a list
Put a list into alphabetical order
Put a list into numerical order
Doesn't do anything a list
prime_numbers = [2, 3, 5, 7, 9, 11]
prime_numbers.remove(9)
print(prime_numbers)
What would be displayed?
2,3,5,7,11
2,3,5,7,9,11
2,1,3,5,7,9,11
2,3,5,7,9,11,9
What does the following code do:
List.Clear()
Removes all elements from a list
Removes all duplicated values from a list
Removes all even indexes from a list
Removes nothing from a list
