Self learning guide for machine learning
Learn the dictionary data structures in python
After completing the exercises below, you should be comfortable with
★☆☆ - Easy
★★☆ - Medium
★★★ - Challenging
★★★★ - Bonus
a -> 2,
c -> 5,
b -> 1,
d -> 3
what is the value for key ‘a’?
what is the value for key ‘x’ ?
Add e -> 4
to the above map
key : ‘a’
key : ‘x’
For example the dict has following KV
a -> 2,
c -> 5,
b -> 1,
d -> 3
existing key : d['a'] --> 2
non existing key returns zero : d['x'] --> 0
For example if the list is
['a', 'b', 'a', 'c', 'b', 'a']
Expected output is :
'a' -> 3,
'b' -> 2,
'c' -> 1
For example, if the dictionary is
a -> 4
b -> 5
c -> 2
The expected output is :
c -> 2
a -> 4
b -> 5