Unit 9 Test Review

Unit 9 Test Review

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

My Sql

My Sql

12th Grade

10 Qs

Latihan Pilihan Ganda - Sketchup

Latihan Pilihan Ganda - Sketchup

9th Grade

15 Qs

Ôn lại kiến thức  Lớp 3 T13

Ôn lại kiến thức Lớp 3 T13

1st - 10th Grade

10 Qs

Wee Word Intro

Wee Word Intro

7th - 12th Grade

12 Qs

SQL 3

SQL 3

11th Grade

14 Qs

Data Structures: Linked Lists and Hashtables

Data Structures: Linked Lists and Hashtables

11th Grade - University

14 Qs

Basic Programming QUIZ

Basic Programming QUIZ

1st - 10th Grade

15 Qs

MIL March 8, 2023

MIL March 8, 2023

12th Grade

10 Qs

Unit 9 Test Review

Unit 9 Test Review

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Julia McGreal

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following program print?

my_grid = [[2, 5, 7, 10], [-3, "hello", 9, "hi"], ["hello", "hi", "hello", "hi"], [True, False, True, False]] print(my_grid[0])

[5, 7, 10, -3, ‘hello’, 9, ‘hi’]

[2, 5]

[[2, 5, 7, 10], [-3, ‘hello’, 9, ‘hi’]]

[2, 5, 7, 10]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following program print?

my_grid = [[2, 5, 7, 10], [-3, "hello", 9, "hi"], ["hello", "hi", "hello", "hi"], [True, False, True, False]] print(my_grid[:2])

[5, 7, 10, -3, ‘hello’, 9, ‘hi’]

[2, 5]

[[2, 5, 7, 10], [-3, ‘hello’, 9, ‘hi’]]

[2, 5, 7, 10]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this program print?

numbers = [x + x for x in range(4)] print(numbers)

[0, 1, 2, 3, 4]

[0, 1, 2, 3]

[2, 4, 6, 8]

[0, 2, 4, 6]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does this program print?

numbers = [x % 2 == 0 for x in range(0, 6)] print(numbers)

[True, False, True, False, True, False]

[0, 1, 0, 1, 0, 1, 0]

[0, 1, 0, 1, 0, 1]

[0, 1, 2, 3, 4, 5]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of packing?

my_list = [1, 2, 3]

x, y, z = my_list

my_list = [1, 2, 3]

x = y = z = my_list

x = 1

y = 2

z = 3

my_list = [x, y, z]

x = 1

y = 2

z = 3

my_list = x = y = z

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct example of unpacking?

my_list = [1, 2, 3]

x, y, z = my_list

my_list = [1, 2, 3]

x = y = z = my_list

x = 1

y = 2

z = 3

my_list = [x, y, z]

x = 1

y = 2

z = 3

my_list = x = y = z

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose you have the following dictionary, which stores the names and ages of people:

my_dictionary = {

"Bo": 32,

"Fiona": 28,

"Carlos": 45

}

Which line correctly prints Bo’s age?

print(my_dictionary[0])

print(my_dictionary[0][1])

print(my_dictionary["Bo"])

print(my_dictionary["Bo"][1])

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?