What is the output of print(dict.fromkeys('ab', 0)) in Python?
print(dict.fromkeys('ab', 0))
Correct answer
C. {'a': 0, 'b': 0}
5 views
C. {'a': 0, 'b': 0}
5 views
dict.fromkeys accepts a value.
Asked in: Python Interview Dictionaries
https://docs.python.org/3/tutorial/datastructures.html#dictionariesNot sure why the answer is C? Ask here and get an explanation.