arrays
使用闪卡高效复习COMPUTER-SCIENCE科目知识点
共计闪卡
12张
8 programming
闪卡自测
Define the term array.
所有闪卡
闪卡 1
问题
Define the term array.
查看答案
答案
An array is an ordered, static set of elements in a fixed-size memory location.
闪卡 2
问题
True or False? An array can store multiple data types.
查看答案
答案
False. An array can only store 1 data type
闪卡 3
问题
What is a 1D array?
查看答案
答案
A 1D array is a linear array.
闪卡 4
问题
What is zero-indexing?
查看答案
答案
Zero-indexing is when array indexes start at 0.
闪卡 5
问题
In pseudocode, how do you create an array of integers named 'scores' with 5 elements?
查看答案
答案
DECLARE scores: ARRAY[0:4] OF INTEGER
闪卡 6
问题
In Python, how do you create an array named 'scores' with values 12, 10, 5, 2, 8?
查看答案
答案
scores = [12, 10, 5, 2, 8]
闪卡 7
问题
What does the len() function do in Python when used with an array?
查看答案
答案
The len() function determines the length of the array.
闪卡 8
问题
What is a 2-dimensional array?
查看答案
答案
A 2-dimensional array extends the concept of a 1D array by adding another dimension.
闪卡 9
问题
How can a 2D array be visualised?
查看答案
答案
A 2D array can be visualised as a table with rows and columns.
闪卡 10
问题
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.**
闪卡 11
问题
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]
闪卡 12
问题
What does minsWatched[1][1] represent in the worked example?
查看答案
答案
minsWatched[1][1] represents the number of minutes that Lyla watched TV on Tuesday (43).