The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #103
my_dict = {"a": 1, "b": 2, "c": 3}
for value in my_dict.items():
print(value)
items() returns a set-like view (type dict_items) backed by the dict. Here, only using value with the for loop returns each element of the set-like view. (stackoverflow.com/questions/3294889/iterating-over-dictio...)
What is the output of the following code snippet?
— The Python Quiz (@thepythonquiz) April 22, 2020
my_dict = {"a": 1, "b": 2, "c": 3}
for value in my_dict.items():
print(value)
('a', 1)
('b', 2)
('c', 3)
1
2
3
'a'
'b'
'c'#python #pythonprogramming #learnpython
Question difficulty: π΅π΅π΅π΅π΅