def lista_simples(lista):
if isinstance(lista, list):
return [sub_elem for elem in lista for sub_elem in lista_simples(elem)]
else:
return [lista]
lista = [["Danilo","Gilson"],["Eduarda",["Costa","Otávio"]]]
resultado = lista_simples(lista)
print(resultado)
ZGVmIGxpc3RhX3NpbXBsZXMobGlzdGEpOgogICAgaWYgaXNpbnN0YW5jZShsaXN0YSwgbGlzdCk6CiAgICAgICAgcmV0dXJuIFtzdWJfZWxlbSBmb3IgZWxlbSBpbiBsaXN0YSBmb3Igc3ViX2VsZW0gaW4gbGlzdGFfc2ltcGxlcyhlbGVtKV0KICAgIGVsc2U6CiAgICAgICAgcmV0dXJuIFtsaXN0YV0KCmxpc3RhID0gW1siRGFuaWxvIiwiR2lsc29uIl0sWyJFZHVhcmRhIixbIkNvc3RhIiwiT3TDoXZpbyJdXV0KcmVzdWx0YWRvID0gbGlzdGFfc2ltcGxlcyhsaXN0YSkKcHJpbnQocmVzdWx0YWRvKQ==