ungleich-learning-circle/kjg/python-the-hard-way/e40.py

21 lines
465 B
Python
Raw Normal View History

2020-06-10 13:37:13 +00:00
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print(line)
ly1 = ["Happy birthday to you", "I don't want to get sued", "So I'll stop right there"]
ly2 = ["They rally around tha family","With pockets full of shells"]
happy_bday = Song(ly1)
bulls_on_parade = Song(ly2)
happy_bday.sing_me_a_song()
bulls_on_parade.sing_me_a_song()