-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsong.py
35 lines (29 loc) · 997 Bytes
/
song.py
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
31
32
33
34
35
class Song(object):
def __init__(self, name, artist, genre, location):
self.name = name
self.artist = artist
self.genre = genre
self.location = location
self.rating = 0
#RETURN SONG INFORMATION
def name(self):
return self.name
def rating(self):
return self.rating
def artist(self):
return self.artist
def genre(self):
return self.genre
#RETURN FULL SONG DESCRIPTION
def description(self):
print("Title: {}".format(self.name))
print("Artist: {}".format(self.artist))
print("Genre: {}".format(self.genre))
print("Rating: {}".format(self.rating))
# SET RATINGS FOR SONGS (Like/Dislike)
def set_rating(self, rating):
self.rating = (rating)
if (rating == 1):
print ("You have liked the current song.")
elif (rating == -1):
print ("You have disliked the current song.")