-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex40.py
More file actions
30 lines (23 loc) · 810 Bytes
/
ex40.py
File metadata and controls
30 lines (23 loc) · 810 Bytes
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
#Moduły, klasy obiekty
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print (line)
def sing_me_word(self):
print (self.lyrics)
happy_bday = Song(["Happy birthady to you",
"Nie chce zostac pozwany",
"Więc tutaj przerwę"])
bulls_on_parade = Song(["They rally around the familly",
"With pockets full of shells"])
a_spoon_of_sugar = Song(["Spoon of sugar",
"to medicine go down",
"to medicine go down",
"and again"])
happy_bday.sing_me_a_song()
bulls_on_parade.sing_me_a_song()
a_spoon_of_sugar.sing_me_a_song()
test_song = "Testowo owo piosenka..."
test_song.sing_me_word()