-2

I work with a function that when you call her it return dictionary, which command shoud I write that will print the keys of the dictionary? Thanks.

jpp
  • 159,742
  • 34
  • 281
  • 339

1 Answers1

0

You can get an iterable object with the keys by calling your_dict.keys()

>>> my_dict = {'1': 'one', '2': 'two'}
>>> for item in my_dict.keys():
        print(item)
1
2
Lelor
  • 46
  • 4