Question #940

What is the output of the code snippet below?
print(dict(enumerate(["a", "b",], 100)))

You can use enumerate() . Also, enumerate() takes as a second argument the first integer of the counter. Here, the result will be {100: 'a', 101: 'b'} (index first, then value). (realpython.com/python-enumerate)


Comment on Disqus:

Question difficulty: 🔵🔵🔵🔵🔵