
CC103 - 2

Quiz
•
Others
•
University
•
Hard
ALVIN CERTEZA
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of: d = {'a': 1, 'b': 2} print(d['c'])
None
0
Error
[]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method returns a list of key-value tuple pairs?
keys()
values()
items()
get()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How to safely access a key that may not exist in a dictionary?
dict['key']
dict.get('key')
dict.key
dict.fetch('key')
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of len({'a': 1, 'b': 2, 'a': 3})?
3
2
1
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does dict.update({'c': 3}) do?
Adds key 'c' with value 3
Replaces dictionary
Clears dictionary
Returns error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will dict.pop('x') do if 'x' does not exist?
Returns None
Raises KeyError
Deletes key
Returns 0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How to loop over dictionary keys and values? for k, v in ___: ...
dict
dict.items()
dict.keys()
dict.values()
Create a free account and access millions of resources
Similar Resources on Wayground
41 questions
stat chapter 2

Quiz
•
University
39 questions
La materia

Quiz
•
University
40 questions
Phrasal Verbs Quiz

Quiz
•
University
40 questions
CC103-1

Quiz
•
University
35 questions
Ciclos repetitivos: MIENTRAS

Quiz
•
University
42 questions
Câu hỏi về Excel

Quiz
•
University
43 questions
Pyetje mbi PHP dhe Zhvillimin e Uebit

Quiz
•
University
37 questions
Nusing mod. 2 - Pt. 1

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade