Skip to main content

Dictionary in Python

 




di = {"Aakash":"pasta","karan":"Maggie","hulk":"Burger","Ravi":{"B":"Oats","L":"Roti","D":"chicken"}}
# print(di["Ravi"]["B"])

# d1 = di
# it will delete Aakash from dictionary
# del d1["Aakash"]
# print(di)

# d1 = di.copy()
# del d1["Aakash"]
# print(di)
# print(di.keys())
# print(di.items())

e = input("Enter: ")
print(di[e])



Comments