
python dictionary
Authored by V. Charles Prabu
Computers
University
Used 18+ times

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 SELECT QUESTION
45 sec • 1 pt
Select correct ways to create an empty dictionary
sampleDict = {}
sampleDict = dict()
sampleDict = dict{}
sampleDict = ()
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following dictionary operation
dict1 = {"name": "Mike", "salary": 8000}
temp = dict1.get("age")
print(temp)
KeyError: ‘age’
None
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Select the all correct way to remove the key ‘marks‘ from a dictionary
student = { "name": "Emma", "class": 9, "marks": 75 }
student.pop(“marks”)
del student[“marks”]
student.popitem()
dict1.remove(“key2”)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Items are accessed by their position in a dictionary and All the keys in a dictionary must be of the same type.
True
False
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Dictionary keys must be immutable
True
False
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements create a dictionary?
d = {}
d = {“john”:40, “peter”:45}
d = {40:”john”, 45:”peter”}
All of the mentioned
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
d["john"]
40
45
“john”
“peter”
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
13 questions
PWM y ADC con el MSP430F5529
Quiz
•
University
15 questions
8051-MCQ
Quiz
•
University
11 questions
Tutorium 1 - Prog2
Quiz
•
University
10 questions
Teoria General de los Sistemas IF1300
Quiz
•
University
11 questions
Java Quizz 2
Quiz
•
University
15 questions
Internet
Quiz
•
University
15 questions
Dictionary Python
Quiz
•
University
10 questions
Basic Networking
Quiz
•
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