Question #103

What is the output of the following code snippet?
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...)


Comment on Disqus:

Comment on Twitter:

Question difficulty: 🔵🔵🔵🔵🔵