Understanding Arrays and Lists in Programming

Understanding Arrays and Lists in Programming

Assessment

Interactive Video

Computers

12th Grade

Hard

Created by

Mr Shorey

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a key characteristic of how arrays store data in memory?

Data is stored randomly.

Data is stored contiguously.

Data is stored in a linked list.

Data is stored in a hash table.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In most programming languages, what is the starting index for elements in an array?

1

0

-1

Any integer specified by the programmer.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a fundamental difference between arrays and lists in terms of the data types they can store?

Arrays can store multiple data types (heterogeneous), while lists can only store a single data type (homogeneous).

Arrays can only store a single data type (homogeneous), while lists can store multiple data types (heterogeneous).

Both arrays and lists can store multiple data types, but arrays are faster.

Both arrays and lists can only store a single data type, but lists are more memory-efficient.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a three-dimensional array declared as myArray[5,5,5], how many index values are required to access a specific element?

One

Two

Three

Five

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a key distinction between a Python list and a Python tuple?

A list can store multiple data types, while a tuple can only store one.

A list is immutable, while a tuple is mutable.

A list can be modified after creation, while a tuple cannot.

A list has a fixed size, while a tuple can grow or shrink.