Skip to content

Instantly share code, notes, and snippets.

View aleglez22's full-sized avatar

Alejandro González aleglez22

  • Ecuador
View GitHub Profile
class Product():
def __init__(self,name,continent,country,city):
self._name=name
self._continent=continent
self._country=country
self._city=city
def get_location(self):
return [self._continent,self._country,self._city]
def recurs_flatten(lista):
result = []
for item in lista:
if type(item) == type([]):
result.extend(recurs_flatten(item))
else:
result.append(item)
return result
# TESTS