<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
// guest
▾
Login
Request Account
[ light ]
// Projects
Projects Quiz
// question 1 of 10
What is the correct way to check if a key exists in a dictionary?
if key == my_dict
if key in my_dict
if my_dict.has(key)
// question 2 of 10
What does the strip() method do?
Splits the string into a list
Removes all spaces from the string
Removes leading and trailing whitespace
// question 3 of 10
What is the purpose of newline="" when writing a CSV file?
Prevents double newlines between rows
Removes all newlines from content
Adds a blank line between rows
// question 4 of 10
What does Counter.most_common(2) return?
The two smallest counts
The two largest values
The two most frequent elements as (value, count) tuples
// question 5 of 10
What does the col_index reset mechanism do in ADFGVX transposition?
Sorts the columns alphabetically
Counts the total number of characters
Cycles through columns by resetting to 0 after the last column
// question 6 of 10
What does for key, value in my_dict.items() do?
Iterates over keys only
Iterates over key-value pairs
Iterates over values only
// question 7 of 10
What does Counter({'a': 3, 'b': 1}) represent?
'a' appears 3 times, 'b' appears once
3 counters named 'a' and 1 named 'b'
A dict with 3 keys
// question 8 of 10
What does uuid.uuid4() generate?
A random universally unique identifier
A sequential integer ID
A timestamp-based string
// question 9 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 10 of 10
What is a key advantage of using an incremental integer ID over a timestamp ID?
It is always unique
It is human-readable and easy to reference
It is faster to generate
Submit Answers →