Python L21 Nesting & Dictionaries

Python L21 Nesting & Dictionaries

6th - 8th Grade

12 Qs

quiz-placeholder

Similar activities

computing 8 ( unit 4) Part 1

computing 8 ( unit 4) Part 1

8th Grade

14 Qs

Passwords and authentication

Passwords and authentication

6th Grade

9 Qs

Code.org: Express Course -> Lesson 1 and 2

Code.org: Express Course -> Lesson 1 and 2

5th - 7th Grade

13 Qs

HTML Quiz #2 Review - CodeHS (Sec 5 & 6)

HTML Quiz #2 Review - CodeHS (Sec 5 & 6)

7th - 10th Grade

9 Qs

Frames In HTML for class 8

Frames In HTML for class 8

8th Grade

10 Qs

Excel If function WSC 4.2.3

Excel If function WSC 4.2.3

7th Grade - University

10 Qs

Python Data Structures

Python Data Structures

8th - 12th Grade

10 Qs

Unit 6 Coding

Unit 6 Coding

6th - 8th Grade

15 Qs

Python L21 Nesting & Dictionaries

Python L21 Nesting & Dictionaries

Assessment

Quiz

Computers

6th - 8th Grade

Hard

Created by

Future Teacher

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does nesting mean in Python dictionaries?

Using only one dictionary

Putting a dictionary or list inside another dictionary

Repeating the same key multiple times

Creating a long list of values

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly shows a list nested inside a dictionary?

{"Germany": "Berlin", ["Munich", "Frankfurt"]}

["Germany": ["Munich", "Berlin"]]

{"Germany": ["Munich", "Berlin"]}

{["Germany"]: "Berlin"}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access "Jakarta" from the following dictionary? travel_log = { "Indonesia": ["Surabaya", "Jakarta", "Bali"] }

travel_log[1]["Indonesia"]

travel_log["Jakarta"]

travel_log["Indonesia"][1]

travel_log["Indonesia"]["Jakarta"]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A dictionary can store only one value per key unless you nest a list or another dictionary inside it.

True

False

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In nested structures, you can combine dictionaries and lists together.

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

This structure is valid: {"A": ["X", {"Y": "Z"}]}

True

False

Answer explanation

Media Image

7.

MATCH QUESTION

1 min • 1 pt

Match the concept to the correct structure:

Simple Dictionary

{"Malaysia": {"total_visited": 14}}

Dictionary inside Dictionary

{"France": "Paris"}

Nested List in Dictionary

{"Indonesia": ["Surabaya", "Bali"]}

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?