[root@mysql1 pshell]# cat ex40.py
#!/usr/bin/env Python
#-*-coding:utf-8-*-
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 therer"])
bulls_on_parade=song(["they relly around the family","with pockets full of shells"])
happy_bday.sing_me_a_song()
bulls_on_parade.sing_me_a_song()
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex40.py
happy birthday to you
i don't want to get sued
so i'll stop right therer
they relly around the family
with pockets full of shells
#!/usr/bin/env Python
#-*-coding:utf-8-*-
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 therer"])
bulls_on_parade=song(["they relly around the family","with pockets full of shells"])
happy_bday.sing_me_a_song()
bulls_on_parade.sing_me_a_song()
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]#
[root@mysql1 pshell]# python ex40.py
happy birthday to you
i don't want to get sued
so i'll stop right therer
they relly around the family
with pockets full of shells