-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex40_2.py
More file actions
36 lines (25 loc) · 1.05 KB
/
Copy pathex40_2.py
File metadata and controls
36 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 2. Put the lyrics in a separate variable, then pass that variable to the
# class to use instead.
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_parade = Song(["They rally around the family",
"With pockets full of shells"])
five_yards = Song(["Be there no-one left on Earth but you",
"One thing shall remain true."])
dc = Song(["D.C. you raised some backs up by the things you said, and",
"You stood your ground while weaker ones just turned and fled, but",
"When it came time to count your foes amongst your friends, well",
"There was respect and so much love that never ends, 'cos",
"D.C. you gave them happiness and hobnob days and they will",
"Cherish them forever and when they get the blues and greys"])
#happy_bday.sing_me_a_song()
#bulls_on_parade.sing_me_a_song()
#five_yards.sing_me_a_song()
#dc.sing_me_a_song()