python "TypeError: object() takes no parameters"

来源:互联网 发布:淘宝怎样进行实名认证 编辑:程序博客网 时间:2024/06/09 21:12
class Song(object):def __init__(self, lyrics):self.lyrics = lyricsdef 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"])happy_bday.sing_me_a_song() 
init()的下划线竟然是两个!!!
阅读全文
0 0
原创粉丝点击