11/29: Dictionary Review

11/29: Dictionary Review

12th Grade

10 Qs

quiz-placeholder

Similar activities

Bab 4 Perangkat Keras

Bab 4 Perangkat Keras

7th Grade - University

13 Qs

ทดสอบพื้นฐานการใช้งานคอมพิวเตอร์

ทดสอบพื้นฐานการใช้งานคอมพิวเตอร์

9th - 12th Grade

10 Qs

ICT S112 Prelim Review Activity

ICT S112 Prelim Review Activity

12th Grade

15 Qs

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

BTEC Level 3 Nat Ext Dip in Computing - Unit 2.1 Hardware and Software

11th - 12th Grade

10 Qs

สอบเก็บคะแนน ไพทอน ม.4

สอบเก็บคะแนน ไพทอน ม.4

9th - 12th Grade

10 Qs

Quiz - Pengenalan Sistem Operasi

Quiz - Pengenalan Sistem Operasi

12th Grade

15 Qs

HTML Quiz 1 Review

HTML Quiz 1 Review

7th - 12th Grade

11 Qs

Kuis tipedata, flowchart informatima kelas X j4njang SMA

Kuis tipedata, flowchart informatima kelas X j4njang SMA

9th - 12th Grade

10 Qs

11/29: Dictionary Review

11/29: Dictionary Review

Assessment

Quiz

Computers

12th Grade

Medium

Created by

GWC Lowell

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of these dictionaries has integers as the keys and strings as the values?

Media Image
Media Image
Media Image
Media Image

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the value of supplies after this code is run?

{"pencil": 12,

"paper": 70, "notebooks": 10, "eraser": 20, "highlighters": 25}

{"pencil": 12,

"paper": 70, "notebooks": 10, "eraser": 20}

{"pencil": 12,

"paper": 30, "notebooks": 10, "eraser": 20,

"paper": 40, "highlighters": 25}

{"pencil": 12,

"paper": 40, "notebooks": 10, "eraser": 20, "highlighters": 25}

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the line of code to initialize an empty dictionary called thesaurus?

thesaurus = new Dictionary()

thesaurus = empty_dict()

thesaurus = {}

thesaurus = []

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What will the following code output?

["veggie burger", "salad", "soda"]

KeyError

"fries"

["hot dog", "apple slices", "orange juice"]

Answer explanation

There is no key:value pair in this dictionary with a key of 3, so this code will produce an error.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What does the following code output?

True

False

KeyError

10

Answer explanation

This code checks for the existence of "notebooks" as a key in the dictionary. Since it exists as a key, it will print True.

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the following code?

Media Image
Media Image
Media Image
Media Image

Answer explanation

This loop goes through each key in the dictionary and prints it.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What will the following code output?

True

KeyError

0

False

Answer explanation

This code checks for the existence of "pen" as a key in the dictionary. "pen" is not a key.

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?