1mydict = {'score1': 41,'score2': 23}
2mydict['score3'] = 45 # using dict[key] = value
3print(mydict)
1#dictionary
2programming = {
3 "Bugs": "These are the places of code which dose not let your program run successfully"
4 ,"Functions":"This is a block in which you put a peice of code"
5 ,"Shell":"This is a place where the code is exicuted"
6 }
7print(programming["Bugs"])
8print(programming["Shell"])
9#Adding items to dictionary
10#Firtly get the access to the dictionary
11programming["Loops"] = "This is a action of doing something repeatedly"
12print(programming["Loops"])
1d = {'a': 1, 'b': 2}
2print(d)
3d['a'] = 100 # existing key, so overwrite
4d['c'] = 3 # new key, so add
5d['d'] = 4
6print(d)
7