Dictionaries | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Dictionaries

For calling Dictionaries arguments, rather than calling by key name (red, yellow ...) is it possible to call like lists ? for example: primary [0] --> "red" or [255, 0, 0] https://code.sololearn.com/cbEWc1yZRsQM/?ref=app

29th Jan 2018, 1:17 PM
NIMA
NIMA - avatar
1 Answer
+ 1
Do you want to iterate through all items in dictionary without knowing the key names? for k, v in d.items(): print(k) print(v)
29th Jan 2018, 7:02 PM
Ravi Chandra Enaganti
Ravi Chandra Enaganti - avatar