Search Header Logo

Dictionary Operations Quiz

Authored by Nisreen Ariwala

Computers

11th Grade

Used 1+ times

Dictionary Operations Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What function creates a dictionary from a sequence of key-value pairs?

tuple()

list()

dict()

set()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method dict1.keys() return?

A list of items

A single value

A list of values

A list of keys

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will dict1.get('Sohan') return if 'Sohan' is not a key in dict1?

0

None

Error

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method dict1.update(dict2) do?

Appends key-value pairs from dict2 to dict1

Creates a new dictionary

Clears dict1

Deletes dict1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of dict1.clear()?

An empty dictionary

An error

None

The original dictionary

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does dict1.items() return?

A list of keys

A list of values

A list of key-value pairs

A single key-value pair

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method returns a list of values in the dictionary?

dict1.keys()

dict1.items()

dict1.get()

dict1.values()

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?