Python Dictionary
Quiz
•
Computers
•
•
Practice Problem
•
Medium
ASIER SOLUTIONS
Used 36+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
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 QUESTION
20 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 QUESTION
20 sec • 1 pt
A Python dictionary stores ...
value - key pairs
key - value pairs
4.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following create an empty dictionary (D)?
D = dict()
D = ()
D = []
D = {}
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which symbol surrounds a dictionary?
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Please select all correct ways to empty the following dictionary
student = {
"name": "Emma",
"class": 9,
"marks": 75
}
del student
del student[0:2]
student.clear()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
________________method will returns number of key-value pairs in the given dictionary.
len( )
pop( )
del( )
keys( )
values( )
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
Quizz Internet
Quiz
•
KG - Professional Dev...
10 questions
Informatica Exercise
Quiz
•
7th Grade
15 questions
Google Nivel 1 7-9
Quiz
•
Professional Development
10 questions
EVALUACION TERCER PERIODO INFORMATICA FSA
Quiz
•
6th Grade
10 questions
Animation 1
Quiz
•
6th Grade
10 questions
Unit 4 Advanced AP CSP
Quiz
•
9th - 12th Grade
10 questions
Culture entrepreneuriale Quizz séance 1
Quiz
•
2nd Grade
15 questions
After Effect Intoduction
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
