Login
Remember
Register
Ask a Question
How do you get a list of all the keys in a dictionary?
0
votes
asked
May 10, 2023
in
Python Flask
by
john ganales
How do you get a list of all the keys in a dictionary?
keyspython
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 10, 2023
by
john ganales
Be specific in these type of Python Interview Questions and Answers.
For this, we use the function keys().
>>> mydict={'a':1,'b':2,'c':3,'e':5}
>>> mydict.keys()
dict_keys([‘a’, ‘b’, ‘c’, ‘e’])
...