Search Header Logo

1D and 2D Arrays in Python

Authored by Kiah Warner

Computers

10th Grade

Used 5+ times

1D and 2D Arrays in Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a 1D array in Python?

arr = [1, 2, 3, 4, 5]

arr = (1, 2, 3, 4, 5)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the third element in a 1D array named 'arr' in Python?

arr.get(3)

arr(2)

arr[3]

arr[2]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you modify the second element in a 1D array named 'arr' to have a value of 5 in Python?

arr.insert(1, 5)

arr.pop(1, 5)

arr[2] = 5

arr[1] = 5

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a 2D array in Python?

A 2D array in Python is a single list with nested elements.

A 2D array in Python is a list of lists.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the element in the second row and third column of a 2D array named 'matrix' in Python?

matrix[1][2]

matrix(1, 2)

matrix[2][3]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you change the value of the element in the first row and second column of a 2D array named 'matrix' to 10 in Python?

matrix[0][1] = 10

matrix[0,1] = 10

matrix[0][2] = 10

matrix[1][0] = 10

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the process of traversing a 2D array called in Python?

Nested loop iteration

Array sorting

Array concatenation

Array filtering

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?