Python - Loop Dictionaries - 6

Python - Loop Dictionaries - 6

12th Grade

10 Qs

quiz-placeholder

Similar activities

Value and Texture

Value and Texture

9th - 12th Grade

10 Qs

ITGS 3.05: Hacking

ITGS 3.05: Hacking

9th - 12th Grade

12 Qs

STEM Innovator® Canvas Terms

STEM Innovator® Canvas Terms

9th - 12th Grade

10 Qs

2D Arrays

2D Arrays

9th - 12th Grade

15 Qs

Python Dictionaries 1

Python Dictionaries 1

12th Grade

10 Qs

Nested Dictionaries - 8

Nested Dictionaries - 8

12th Grade

10 Qs

Final Cut Pro Lesson 1

Final Cut Pro Lesson 1

9th - 12th Grade

14 Qs

Easy Riddles

Easy Riddles

KG - Professional Development

15 Qs

Python - Loop Dictionaries - 6

Python - Loop Dictionaries - 6

Assessment

Quiz

Other

12th Grade

Hard

Created by

Amy Austin

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method is used to loop through the values of a dictionary in Python?

keys()

values()

items()

loops()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method returns the keys of a dictionary?

getKeys()

keys()

keySet()

allKeys()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you loop through both keys and values of a dictionary?

for key, value in dictionary.values():

for key in dictionary.keys():

for key in dictionary:

for key, value in dictionary.items():

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to print all key names in a dictionary, one by one?

print(allKeys in dictionary)

print(dictionary.keys())

for x in dictionary: print(x)

dictionary.printKeys()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid method for dictionaries in Python?

items()

values()

delete()

copy()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you add items to a dictionary?

dictionary[key] = value

add.dictionary(key:value)

dictionary.add(key:value)

dictionary.append(key:value)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to copy a dictionary?

copyDict()

duplicate()

clone()

copy()

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?