Dictionary Operations Quiz

Dictionary Operations Quiz

11th Grade

7 Qs

quiz-placeholder

Similar activities

Databases Quiz 3

Databases Quiz 3

7th - 11th Grade

7 Qs

Dasar Koding dan Kecerdasan Artifisial

Dasar Koding dan Kecerdasan Artifisial

11th Grade

10 Qs

Lý thuyết về Python

Lý thuyết về Python

3rd Grade - University

10 Qs

Search Algorithms

Search Algorithms

9th - 11th Grade

12 Qs

HTML Quiz 1 Review

HTML Quiz 1 Review

7th - 12th Grade

11 Qs

Dictionary in Python

Dictionary in Python

11th - 12th Grade

10 Qs

DIctionary

DIctionary

11th Grade

11 Qs

Dictionary Operations Quiz

Dictionary Operations Quiz

Assessment

Quiz

Computers

11th Grade

Medium

Created by

Nisreen Ariwala

Used 1+ times

FREE Resource

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()