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
Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?
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 Wayground
20 questions
Output Quiz-9

Quiz
•
University
20 questions
1st Year quiz

Quiz
•
University
11 questions
oop_r2

Quiz
•
University
18 questions
8-mavzu. Python va MySQLda ma’lumot kiritish va tahrirlash

Quiz
•
University
15 questions
SCRIPTING PROGRAMMING WITH PYTHON

Quiz
•
University
15 questions
Python функциялары 7 сынып

Quiz
•
12th Grade - University
15 questions
DASPRO RESPONSI - 1

Quiz
•
University
12 questions
Python: Strings and Lists

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University