get all key of dict python code example
Example 1: python list keys from dictionary
# Basic syntax:
list_of_keys = list(dictionary.keys())
Example 2: python convert dict_keys to list
d = {1:1, 2:2, 3:3}
d_keys_list = list(d.keys())
Example 3: get all keys and values from dictionary python
#python 3
for k,v in dict.items():
print(k, v)