1D and 2D Arrays in Python

1D and 2D Arrays in Python

10th Grade

13 Qs

quiz-placeholder

Similar activities

Python Basics - Quiz

Python Basics - Quiz

8th - 11th Grade

10 Qs

Array

Array

10th - 12th Grade

15 Qs

APCSA Unit 6 Review Arrays

APCSA Unit 6 Review Arrays

9th - 12th Grade

17 Qs

GCSE Computer Science Paper 2: Topic 2.2

GCSE Computer Science Paper 2: Topic 2.2

10th Grade

11 Qs

Stencyl 2.5

Stencyl 2.5

1st - 12th Grade

13 Qs

Review in Computer 10 1st Summative

Review in Computer 10 1st Summative

10th Grade

15 Qs

2D Arrays

2D Arrays

9th - 12th Grade

12 Qs

Матрицы и генераторы списков

Матрицы и генераторы списков

10th Grade

12 Qs

1D and 2D Arrays in Python

1D and 2D Arrays in Python

Assessment

Quiz

Computers

10th Grade

Medium

Created by

Kiah Warner

Used 5+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?