0Still learning
Know0
Enjoying Flashcards?
Tell us what you think
Define the term array.
An array is an ordered, static set of elements in a fixed-size memory location.
True or False?
An array can store multiple data types.
False.
An array can only store 1 data type
What is a 1D array?
A 1D array is a linear array.
What is zero-indexing?
Zero-indexing is when array indexes start at 0.
In pseudocode, how do you create an array of integers named 'scores' with 5 elements?
DECLARE scores: ARRAY[0:4] OF INTEGER
In Python, how do you create an array named 'scores' with values 12, 10, 5, 2, 8?
scores = [12, 10, 5, 2, 8]
What does the len()
function do in Python when used with an array?
The len()
function determines the length of the array.
What is a 2-dimensional array?
A 2-dimensional array extends the concept of a 1D array by adding another dimension.
How can a 2D array be visualised?
A 2D array can be visualised as a table with rows and columns.
True or False?
When navigating through a 2D array, you first go across the columns and then down the rows.
False.
When navigating through a 2D array, you first go down the rows and then across the columns.
In Python, how do you access the element in the second row, third column of a 2D array named 'array_2d'?
array_2d[1][2]
What does minsWatched[1][1]
represent in the worked example?
| Quinn | Lyla | Harry | Elias | |
0 | 1 | 2 | 3 | ||
Monday | 0 | 34 | 67 | 89 | 78 |
Tuesday | 1 | 56 | 43 | 45 | 56 |
Wednesday | 2 | 122 | 23 | 34 | 45 |
Thursday | 3 | 13 | 109 | 23 | 90 |
Friday | 4 | 47 | 100 | 167 | 23 |
minsWatched[1][1]
represents the number of minutes that Lyla watched TV on Tuesday (43).