DICTIONARIES

DICTIONARIES

Assessment

Assessment

Created by

DHARMENDRA THAKUR

Computers

11th Grade

19 plays

Medium

Improve your activity

Higher order questions

Match

Reorder

Categorization

Quizizz AI

actions

Add similar questions

Add answer explanations

Translate quiz

Tag questions with standards

More options

8 questions

Show answers

1.

Multiple Choice

30 sec

1 pt

Which of the following is not a valid way to define this dictionary in Python:

d = dict([

('foo', 100),

('bar', 200),

('baz', 300)

])

d = {}

d['foo'] = 100

d['bar'] = 200

d['baz'] = 300

d = dict(foo=100, bar=200, baz=300)

d = {'foo': 100, 'bar': 200, 'baz': 300}

d = { ('foo', 100), ('bar', 200), ('baz', 300) }

2.

Multiple Choice

30 sec

1 pt

Consider this dictionary:


d = {'foo': 100, 'bar': 200, 'baz': 300}


What is the result of this statement:


d['bar':'baz']

It raises an exception

(200, 300)

200 300

[200, 300]

3.

Multiple Choice

30 sec

1 pt

Suppose x is defined as follows:

x = [

'a',

'b',

{

'foo': 1,

'bar':

{

'x' : 10,

'y' : 20,

'z' : 30

},

'baz': 3

},

'c',

'd'

]

What is the expression involving x that accesses the value 30?

x[2]["bar"]["z"]

x[2]["bar"]

x["bar"]["z"]

x[2]["bar"]["z"][3]

4.

Multiple Choice

30 sec

1 pt

A Python dictionary stores ...

value - key pairs

key - value pairs

5.

Multiple Select

30 sec

1 pt

Which of the following create an empty dictionary (D)?

D = dict()

D = ()

D = []

D = {}

6.

Multiple Choice

30 sec

1 pt

Which symbol surrounds a dictionary?

{

(

[

:

cartoon woman

Explore this activity with a free account

Find a similar activity

Create activity tailored to your needs using

Quizizz AI
Input Output and Storage Devices

16 questions

Input Output and Storage Devices

assessment

1st - 4th Grade

Principles of Programming Languages

100 questions

Principles of Programming Languages

assessment

University

Java Programming

23 questions

Java Programming

lesson

2nd Grade

Revision Test

45 questions

Revision Test

assessment

4th - 5th Grade

Android

10 questions

Android

assessment

2nd - 5th Grade

Input and Output Device

10 questions

Input and Output Device

assessment

1st - 2nd Grade

Algorithms and Flowcharts

10 questions

Algorithms and Flowcharts

assessment

3rd - 5th Grade

Windows Basics

10 questions

Windows Basics

assessment

5th Grade