-
Notifications
You must be signed in to change notification settings - Fork 0
/
practice40.py
59 lines (41 loc) · 1.56 KB
/
practice40.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Now pass the lyrics as a separate variable, and 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)
tainted_love = ["Sometimes I feel I've got to",
"Run away",
"I've got to, get away",
"Don't really want anymore from me to make things right"]
this_is_the_new = ["Are you motherf*ckers ready",
"For the new $@#%",
"Stand up and admit"]
print("{Tained Love}")
tainted_love_song = Song(tainted_love) # Need to make it as a new variable! Then tell it to load the list of lyrics
tainted_love_song.sing_me_a_song() # Then do the func
print(" ")
print("{This Is the New...}")
this_is_song = Song(this_is_the_new)
this_is_song.sing_me_a_song()
# Tthe original
""" class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print(line)
tainted_love = Song(["Sometimes I feel I've got to",
"Run away",
"I've got to, get away",
"Don't really want anymore from me to make things right"])
this_is_the_new = Song(["Are you motherf*ckers ready",
"For the new $@#%",
"Stand up and admit"])
print("{Tained Love}")
tainted_love.sing_me_a_song()
print(" ")
print("{This Is the New...}")
this_is_the_new.sing_me_a_song()
"""