# Basic syntax:
list_of_keys = list(dictionary.keys())
# To get all the keys of a dictionary as a list, see below
newdict = {1:0, 2:0, 3:0}
list(newdict)
# Output:
# [1, 2, 3]
>>> newdict = {1:0, 2:0, 3:0}
>>> [*newdict]
[1, 2, 3]
"""
In [1]: newdict = {1:0, 2:0, 3:0}
In [2]: %timeit [*newdict]
107 ns ± 5.42 ns per loop
In [3]: %timeit list(newdict)
144 ns ± 7.99 ns per loop
In [4]: %timeit [k for k in newdict]
257 ns ± 21.6 ns per loop
"""
>>> list(newdict.keys()) # don't do this.
newlist = list()
for i in newdict.keys():
newlist.append(i)
list(newdict.keys())