DIctionary

DIctionary

11th Grade

11 Qs

quiz-placeholder

Similar activities

C Operators #1

C Operators #1

10th Grade - University

10 Qs

Python IF Statements

Python IF Statements

9th - 12th Grade

10 Qs

Python Basics

Python Basics

6th - 12th Grade

9 Qs

Dictionary in Python

Dictionary in Python

11th - 12th Grade

10 Qs

Python: списки, кортеж, словник, множина

Python: списки, кортеж, словник, множина

9th - 12th Grade

14 Qs

Dictionary in Python

Dictionary in Python

7th - 12th Grade

10 Qs

Python Basics 2

Python Basics 2

11th Grade

15 Qs

PythonTest

PythonTest

6th Grade - Professional Development

11 Qs

DIctionary

DIctionary

Assessment

Quiz

Computers

11th Grade

Hard

Created by

NAVTESH DAGUR

Used 10+ times

FREE Resource

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Dictionaries are also called _____

mappings

hashes

associative arrays

all of the above

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following will raise an error if the given key is not found in the dictionary ?

del statement

pop()

getitem()

all of these

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What type of error will occur when the following code is run?

myDict = {"Sam": 100, "Nak": 99, "Paul": 99, "Ronnie": 99}

print(myDict["Hemant"])

ValueError

KeyError

Typeerror

Syntaxerror

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following code:

dict1 = {}

d2 = dict1.fromkeys(["key1", "key2", "key3"], ["value"])

print(d2)

{‘key1’ : ‘value’ , ’key2’ : ’value’, ‘key3’ : ’value’}

{‘key1’ : ‘value’ , ’key2’ : ’none’, ‘key3’ : ’none’}

{‘key1’ : [‘value’] , ’key2’ : None, ‘key3’ : None}

{‘key1’ : [‘value’] , ’key2’ : [‘value’] , ‘key3’ : [‘value’]}

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

The keys and values of a dictionary are:

mutable, immutable

immutable, mutable

both immutable

both mutable

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following code:

d = {"Inception": "Christopher Nolan",

"Endgame": "Russo Brothers",

"No Way Home": "Jon Watts"}

for i in d:

print(i)

Inception: Christopher Nolan

Endgame: Russo Brothers

No Way home: Jon Watts

Inception

Endgame

No Way Home

Inception

Endgame

No Way Home

Error

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Dictionary are set of elements

sorted

ordered

unordered

random

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?