In Python 2.7, I could get dictionary keys, values, or items as a list:
>>> newdict = {1:0, 2:0, 3:0}
>>&g
If you need to store the keys separately, here's a solution that requires less typing than every other solution presented thus far, using Extended Iterable Unpacking (python3.x+).
newdict = {1: 0, 2: 0, 3: 0}
*k, = newdict
k
# [1, 2, 3]
╒═══════════════╤═════════════════════════════════════════╕
│ k = list(d) │ 9 characters (excluding whitespace) │
├───────────────┼─────────────────────────────────────────┤
│ k = [*d] │ 6 characters │
├───────────────┼─────────────────────────────────────────┤
│ *k, = d │ 5 characters │
╘═══════════════╧═════════════════════════════════════════╛