I've written my own simple solution for flatten list:
lists = [0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]]
new = []
for item in lists:
if str(item).isdigit() != True:
for v in item:
new.append(v)
else:
new.append(item)
print(new)
But I want to add an else/elif to the following code to make code shorter:
new = [v for item in lists if str(item).isdigit() != True for v in item]
I don't know how to rather getting syntax errors.