+ 2
Can you please choose the right ones and explain me the choices?
Which of the followings are correct? 1.Dictionaries can have Dictionaries as values. 2.Dictionaries can have List as values. 3.List can have Dictionaries as elements. 4.Dictionaries can have list as keys.
5 Réponses
+ 2
dictionaries can have only immutable types as keys, therefore only string, number and tuple can be a key of a dictionary.
it can have any data type as values which are lists, dictionaries, sets
+ 2
keys must be immutable
values can be everything
0
Thanks!!
0
Thanks a lot.