Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?
PAP Module-3 Part-2

Quiz
•
Computers
•
University
•
Hard

Manzoor Ahmed
Used 6+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
d.size()
len(d)
size(d)
d.len()
2.
MULTIPLE CHOICE QUESTION
30 sec • 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)
3.
MULTIPLE CHOICE QUESTION
30 sec • 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
None
Error
4.
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
5.
MULTIPLE CHOICE QUESTION
30 sec • 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
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
for i,j in a.items():
print(i,j,end=" ")
1 A 2 B 3 C
1 2 3
A B C
1:”A” 2:”B” 3:”C”
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code snippet?
a={1:"A",2:"B",3:"C"}
print(a.setdefault(3))
{1: ‘A’, 2: ‘B’, 3: ‘C’}
C
{1: 3, 2: 3, 3: 3}
No method called setdefault() exists for dictionary
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
Python Programming - Test 1

Quiz
•
University - Professi...
12 questions
CSSE Quiz Day2

Quiz
•
University
15 questions
Python Programming Intermediate-1

Quiz
•
University
11 questions
Python If statement

Quiz
•
University
12 questions
Python Quiz 1.6

Quiz
•
University
20 questions
ASK T2 - Kod Arahan (Python)

Quiz
•
7th Grade - University
20 questions
Day 6 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Quiz
•
University
15 questions
CSE 102 Exam 2 Practice

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade