how to get the first key in dictionary python code example
Example 1: print first dictionary keys python
first_key = list(my_dict.keys())[0]
print(first_key)
Example 2: access first element of dictionary python
res = next(iter(test_dict))
first_key = list(my_dict.keys())[0]
print(first_key)
res = next(iter(test_dict))