Examveda

What will be the output of the following code:
keys = ['a', 'b', 'c']
values = 0
my_dict = dict.fromkeys(keys, values)
print(my_dict)

A. {'a': 0, 'b': 0, 'c': 0}

B. {'a': [0], 'b': [0], 'c': [0]}

C. {0: ['a', 'b', 'c']}

D. {'a': 'b', 'b': 'c', 'c': 0}

Answer: Option A


This Question Belongs to Python Program >> Dictionary In Python

Join The Discussion

Related Questions on Dictionary in Python