<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Projects
Projects Quiz
// question 1 of 10
What does f.read() do after the file pointer has reached the end?
Raises an error
Returns an empty string
Reads the file again from the beginning
// question 2 of 10
What is the output of: min({"a": 3, "b": 1, "c": 2})?
'a'
'b'
1
// question 3 of 10
What does int("42") return?
A float 42.0
The string "42"
The integer 42
// question 4 of 10
What happens when you open a file with 'w' mode and it already exists?
It is overwritten completely
It raises a FileNotFoundError
It appends to the existing content
// question 5 of 10
What does csv.DictReader do?
Writes a dictionary to CSV
Reads each CSV row as a dictionary
Reads the CSV into a list of lists
// question 6 of 10
What does strftime("%Y-%m-%d") return?
The current time in seconds
A datetime object
A date formatted as YYYY-MM-DD
// question 7 of 10
What does split(';') do on a string?
Removes all semicolons
Splits the string at every semicolon
Splits at every character
// question 8 of 10
What does paws_dict[id][5] = "adopted" do in the Safe Paws project?
Removes the animal from the dictionary
Updates the status field of the animal with the given id
Adds a new animal to the dictionary
// question 9 of 10
What is the output of: bool("")?
None
False
True
// question 10 of 10
What is the purpose of newline="" when writing a CSV file?
Removes all newlines from content
Adds a blank line between rows
Prevents double newlines between rows
Submit Answers →