PythonDictionarykeys
get

keysDictionary

values

Returns a view of all keys in the dictionary.

Syntax

dict.keys()

Example

Enter values below to update the example in real time.

person
print
list
keys
person = {"name": "Alice", "age": 30}
print(list(person.keys()))  # ['name', 'age']