<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Projects
Projects Quiz
// question 1 of 10
What does the load_from_txt() pattern do in the projects?
Saves a dictionary to a file
Reads a file and populates a dictionary
Validates user input
// question 2 of 10
What does defaultdict(list) do when a missing key is accessed?
Creates the key with an empty list as value
Returns None
Raises a KeyError
// question 3 of 10
What does uuid.uuid4() generate?
A random universally unique identifier
A sequential integer ID
A timestamp-based string
// question 4 of 10
What is the difference between remove() and discard() on a set?
remove() raises KeyError if missing, discard() does not
They are identical
discard() raises KeyError if missing, remove() does not
// question 5 of 10
What is the purpose of newline="" when writing a CSV file?
Removes all newlines from content
Prevents double newlines between rows
Adds a blank line between rows
// question 6 of 10
What is the output of: [x**2 for x in range(4)]?
[1, 4, 9, 16]
[0, 1, 2, 3]
[0, 1, 4, 9]
// question 7 of 10
What does the get() method return when a key is missing?
None by default, or a specified default
A KeyError
An empty string
// question 8 of 10
What does os.path not provide in this course?
It was not covered in this course
Dictionary operations
File reading functions
// question 9 of 10
What does strptime("2025-04-07", "%Y-%m-%d") return?
A formatted string
A date integer
A datetime object
// question 10 of 10
What is the output of: "2025-04-07".split("-")?
['2025', '04', '07']
['2025-04-07']
['2025', '04-07']
Submit Answers →