class Filme:
def __init__(self, name, year, duration):
self.__name = name.lower().title()
self.year = year
self.duration = duration
self.__likes = 0
@property
def likes(self):
return self.__likes
@property
def name(self):
return self.__name
@name.setter
def name(self, new_name):
self.__name = new_name.lower().title()
def give_likes(self):
self.__likes += 1
class Serie:
def __init__(self, name, year, seasons):
self.__name = name.lower().title()
self.year = year
self.seasons = seasons
self.__likes = 0
@property
def likes(self):
return self.__likes
@property
def name(self):
return self.__name
@name.setter
def name(self, new_name):
self.__name = new_name.lower().title()
def give_likes(self):
self.__likes += 1
vingadores = Filme('Vingadores - Guerra infinita', 2018, 160)
print(f'Nome: {vingadores.name} - Ano: {vingadores.year} - Duração: {vingadores.duration} - Likes: {vingadores.likes}')
atlanta = Serie('Atlanta', 2018, 2)
print(f'Nome: {atlanta.name} - Ano: {atlanta.year} - Temporadas: {atlanta.seasons} - Likes: {atlanta.likes}')