something = {'1': {'2': {'11': {'12': {'13': {'14': {'15': {'16': {'17': {
    '18': {}}}}}}}}, '3': {'4': {}, '5': {}, '7': {}}, '8': {'10': {}, '9':
    {}}}}}
a = []

def flatten(d, a):
    for k, v in list(d.items()):
        a.append(k)
flatten(v, a)
flatten(something, a)
Converting a dictionary into a list