<
RHD
/>
Home
Blog
Quiz
Resources
About
Contact
Enlist
// guest
▾
Login
Request Account
[ light ]
// Projects
Projects Quiz
// question 1 of 10
What does for key, value in my_dict.items() do?
Iterates over values only
Iterates over key-value pairs
Iterates over keys only
// question 2 of 10
What does the col_index reset mechanism do in ADFGVX transposition?
Sorts the columns alphabetically
Cycles through columns by resetting to 0 after the last column
Counts the total number of characters
// question 3 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 4 of 10
What is the output of: list("Bull")?
['Bull']
['B', 'u', 'l', 'l']
('B', 'u', 'l', 'l')
// question 5 of 10
What is the output of: sorted({"B": 1, "A": 2, "C": 3})?
{'A': 2, 'B': 1, 'C': 3}
[1, 2, 3]
['A', 'B', 'C']
// question 6 of 10
What is the output of: "hello world".split()?
['hello', 'world']
('hello', 'world')
['h','e','l','l','o',' ','w','o','r','l','d']
// question 7 of 10
What does int("42") return?
The string "42"
The integer 42
A float 42.0
// question 8 of 10
What is the output of: {x for x in [1,2,2,3,3]}?
[1, 2, 3]
{1, 2, 3}
(1, 2, 2, 3, 3)
// question 9 of 10
What is the purpose of if __name__ == "__main__"?
Runs code only when the file is executed directly, not when imported
Checks if the module name is correct
Prevents the file from being imported
// question 10 of 10
What does a set guarantee about its elements?
All elements are unique
Elements are ordered
Elements can be any type including lists
Submit Answers →