def convert_to_list(obj):
    obj_list = []
for i in range(len(obj)):
    if i not in obj:
        return obj
obj_list.append(obj[i])
return obj_list
How to convert Python dict to JSON as a list, if possible