In [9]:
d = {"a":1,"b":2,"C":3,"name":"Shashank"}
In [10]:
d
Out[10]:
In [4]:
d.keys()
Out[4]:
In [5]:
d["a"]
Out[5]:
In [6]:
d.items()
Out[6]:
In [7]:
d.values()
Out[7]:
In [15]:
d["name"].upper()
Out[15]:
In [16]:
d["name"][::-1]
Out[16]:
In [19]:
d["b"] -1
Out[19]:
In [20]:
d = {"A":{"B":{"C":"value"}}}
In [21]:
d
Out[21]:
In [23]:
d["A"]["B"]["C"].upper()
Out[23]:
In [24]:
d = {}
In [25]:
d["K1"] = 1
d["k2"] = 2
d["K3"] = 3
In [26]:
d
Out[26]:
In [27]:
d.keys()
Out[27]:
In [28]:
d.values()
Out[28]:
In [29]:
d.items()
Out[29]:
In [32]:
for k,v in d.items():
print(k,v)
In [33]:
for k in d.keys():
print(k)
In [34]:
for v in d.values():
print(v)
In [ ]: