I don't get how my code doesn't run from Powershell. It's giving me this error message:
Traceback (most recent call last):
File "ex40.py", line 12, in <module>
"So I'll stop right here"])
TypeError: object() takes no parameters
This is my code:
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 here"])
bulls_on_parade = Song(["They rally around the family",
"With pockets full of shells"])
happy_bday.sing_me_a_song()
bulls_on_parade.sing_me_a_song()
I see in the book and other exact copies and the look all the same to mine(at least I think), but theirs is able to run.