Which of the following can be used as a key for a dictionary? Select all that apply dictionary list string Tuple set | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which of the following can be used as a key for a dictionary? Select all that apply dictionary list string Tuple set

List String tuple dictionary set

7th Mar 2023, 12:38 PM
Dhananjay Netam
2 Answers
+ 4
Dhananjay Netam Is this module quiz?
7th Mar 2023, 12:48 PM
R๐Ÿ’ ๐Ÿ‡ฎ๐Ÿ‡ณ
R๐Ÿ’ ๐Ÿ‡ฎ๐Ÿ‡ณ - avatar
+ 1
Hi, Dhananjay Netam ! You should read about harshable objects. All immutable objects kan be used as keys in dictionaries. Tuples too, as long as its element are harshable (the canโ€™t be list etc).
7th Mar 2023, 5:01 PM
Per Bratthammar
Per Bratthammar - avatar