Get python dictionary keys and values

The contents of a dictionary are in key:value pairs in braces {}

E.g. dict={key1:value1,key2:value2}

dict = {}dict['d'] = 'delhi'
dict['b'] = 'bangalore'
# to get list of keys
keys = list(dict.keys())
# To get list of values
values = list(dict.values())
# Print the list of keys # output = ['d','b']
print(keys)
# Print the list of values # output = ['delhi','bangalore']
print(values)