+ 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
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)