Boa noite, instrutor.
Eu fiz o código para a Playlist de forma diferente, poderia me dizer se também está correta?
class Playlist:
def __init__(self, name, programs):
self.__name = name.title()
self.programs = programs
def size(self):
return len(self.programs)
@property
def name(self):
return self.__name
@name.setter
def name(self, value):
self.__name = value.title()
def playlist(self):
print(f"Playlist {self.name}\n")
for program in self.programs:
program.info()
print("--------------------------------------------------")
atlanta = Series("Atlanta - o reino perdido", 2018, 2)
atlanta.give_likes()
avengers = Movie("avengers - infinity war", 2018, 160)
avengers.give_likes()
avengers.give_likes()
dvf = Movie("de volta para o futuro", 1990, 65)
dvf.give_likes()
dvf.give_likes()
dvf.give_likes()
dvf.give_likes()
dvf.give_likes()
dvf.give_likes()
flash = Series("the flash", 2014, 9)
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
flash.give_likes()
movies_series = [avengers, atlanta, flash, dvf]
weekend_playlist = Playlist("Fim de Semana", movies_series)
weekend_playlist.playlist()