EX40
阿新 • • 發佈:2019-01-13
1 class Song(object): 2 3 def __init__(self): 4 5 self.lyrics = ["這一路上走走停停,", 6 "順著少年漂流的痕跡,", 7 "什麼也不省心。"] 8 9 def sing_me_a_song(self): 10 for line in self.lyrics: 11 print(line) 12 13 thing = Song()14 thing.sing_me_a_song()