0 votes
in Python by
How do you get a list of all the keys in a dictionary?

1 Answer

0 votes
by

One of the ways we can get a list of keys is by using: dict.keys()

This method returns all the available keys in the dictionary. dict = {1:a, 2:b, 3:c} dict.keys()

o/p: [1, 2, 3]

Related questions

0 votes
asked Sep 25, 2021 in Python by john ganales
0 votes
asked Feb 6 in Python by SakshiSharma
...