Search Header Logo

Dictionary in Python

Authored by Amna Sajjad

Computers

8th Grade

Used 14+ times

Dictionary in Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

A dictionary is 'like' a list.

True

False

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

In a dictionary, each key maps to a _____________.

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

How would you create an empty Dictionary? Select all that apply.

a=dict()

a={}

a=dict[]

a=dict

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Curly braces {} represent a list, the same way square brackets [] represent a dictionary.

True

False

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

When you print a dictionary, the order of the key-value pairs may not be the same!

True

False

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What would the len() function print in the following code?

a_dictionary={"a":1,"b":1,"c":1,"d":1,"e":5}

print(len(a_dictionary))

5

10

Error

None of these

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What method in dictionaries takes a key and a default value?

find()

get()

search()

lookup()

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?