Python Dictionaries Quiz 1

Python Dictionaries Quiz 1

9th - 12th Grade

15 Qs

quiz-placeholder

Similar activities

Photoshop

Photoshop

7th - 11th Grade

20 Qs

HTML tags

HTML tags

9th - 12th Grade

20 Qs

Desain Grafis

Desain Grafis

12th Grade

11 Qs

Comp Sci Unit 3 #9

Comp Sci Unit 3 #9

11th Grade

10 Qs

ADD Unit 2 CSS Basics

ADD Unit 2 CSS Basics

9th - 12th Grade

10 Qs

AP CSP Unit 6

AP CSP Unit 6

10th - 12th Grade

20 Qs

Boolean Logic

Boolean Logic

9th - 12th Grade

10 Qs

Excel Mastery Quiz

Excel Mastery Quiz

12th Grade

15 Qs

Python Dictionaries Quiz 1

Python Dictionaries Quiz 1

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Daniel Gosch

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What does the code for an empty dictionary look like?

{ }

[ ]

( )

< >

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What does a dictionary value with a key 'foo' and a value 42 look like?

{'foo': 42}

{key = foo: value = 42}

{foo, 42}

{42: 'foo'}

3.

MULTIPLE SELECT QUESTION

15 mins • 1 pt

>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}

Which of the two are keys in the myCat dictionary?

size

color

gray

loud

4.

MULTIPLE SELECT QUESTION

15 mins • 1 pt

>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}

Which of the two answers are values in the myCat dictionary?

size

color

gray

loud

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}

What will the following code return?

>>> myCat['size']

size

fat

gray

loud

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}

What will the following code return?

>>> myCat['color']

size

fat

gray

loud

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

>>> myCat = {'size': 'fat', 'color': 'gray', 'disposition': 'loud'}

What will the following code return?

>>> myCat['age']

IndexError

KeyError

IndexValueError

12

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?