1# Dictionary
2dict1 = {1:'A', 2:'B', 3:'C'}
3
4# List of the keys
5keysList = list(dict1.keys())
6print(keysList)
7# List of the values
8valuesList = list(dict1.values())
9print(valuesList)
1# To get all the keys of a dictionary use 'keys()'
2newdict = {1:0, 2:0, 3:0}
3newdict.keys()
4# Output:
5# dict_keys([1, 2, 3])
1#dictionariies
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"])
9for eliment in programming:
10 print(eliments)
1# To get all the keys of a dictionary as a list, see below
2newdict = {1:0, 2:0, 3:0}
3list(newdict)
4# Output:
5# [1, 2, 3]