# To get all the keys of a dictionary use 'keys()' newdict = {1:0, 2:0, 3:0} newdict.keys() # Output: # dict_keys([1, 2, 3])
# Python program to get # dictionary keys as list def getList(dict): return dict.keys() # Driver program dict = {1:'Geeks', 2:'for', 3:'geeks'} print(getList(dict))
d = {2:"hello"} d.values()