class song(object):
def init(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print(line)
happy_bday = song([“Happy birthday to you”,
“I don’t want to get sued”,
“So I’ll stop right there”])
bulls_on_parede = song([“They rally around tha family”,
“With pockets full of shells”])
happy_bday.sing_me_a_song()
bulls_on_parede.sing_me_a_song()
A classe song esta correta .
Minha duvida é como executar ela no script do Ex40
import mystuff
from mystuff import MyStuff
from song import song
mystuff.apple()
print(mystuff.tangerina)
thing = MyStuff()
thing.apple()
print(thing.tangerina)
som = song(song)
print(som)
print(som.lyrics)
#som.sing_me_a_song()
#print(som.happy_bday())
#print(som.bulls_on_parede)
eu conseguir executar o módulo mystuff e a classe MyStuff.
porém estou tento dificuldade para executar a classe song