is dictionarys are mainly used in 2 ways of storing data? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

is dictionarys are mainly used in 2 ways of storing data?

yes it stores key is one value and value is another value

14th Mar 2017, 11:12 AM
GADE. NAVEEN
GADE. NAVEEN - avatar
1 Answer
+ 1
ages = {"Dave": 24, "Mary": 42, "John": 58} print(ages["Dave"]) print(ages["Mary"]) in this example name ex(Dave) is key and age(24) is value
14th Mar 2017, 11:14 AM
GADE. NAVEEN
GADE. NAVEEN - avatar