
Python practice quiz 6
Quiz
•
Professional Development
•
Professional Development
•
Practice Problem
•
Medium
Assoc.Prof,IT Chennai
Used 1+ times
FREE Resource
Enhance your content in a minute
18 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(d)
“john”, 40, “peter”, 45
{‘john’: 40, ‘peter’: 45}
40 and 45
d = (40:”john”, 45:”peter”)
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code snippet?
>>> d = {"john":40, "peter":45}
>>> "john" in d
true
false
none
eror
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code snippet?
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
d1 > d2
true
false
error
none
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Suppose d = {“john”:40, “peter”:45}, to delete the entry for “john” what command do we use?
d.delete(“john”:40)
d.delete(“john”)
del d[“john”]
del d(“john”:40)
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(list(d.keys()))
[“john”, “peter”]
[“john”:40, “peter”:45]
(“john”, “peter”)
(“john”:40, “peter”:45)
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of these about a dictionary is false?
The values of a dictionary can be accessed using keys
The keys of a dictionary can be accessed using values
Dictionaries aren’t ordered
Dictionaries are mutable
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.get(1,4))
1
A
4
invalid syntax for get method
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
16 questions
Google Classroom
Quiz
•
Professional Development
20 questions
Claro combo TV
Quiz
•
Professional Development
15 questions
Corso piccoli mezzi di spegnimento
Quiz
•
Professional Development
15 questions
Verilog Fundamentals
Quiz
•
Professional Development
18 questions
CC105_Quiz3
Quiz
•
Professional Development
20 questions
COP Process Engineer
Quiz
•
KG - Professional Dev...
20 questions
DEFINITE PROTECTION
Quiz
•
Professional Development
20 questions
CPR_Quiz_Arrays and strings
Quiz
•
Professional Development
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
