-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
26 lines (21 loc) · 1 KB
/
main.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
from classes import Artist, Album, Song
if __name__ == '__main__':
artist1 = Artist('Steve', 'UK')
artist2 = Artist('John', 'USA')
steve_album1 = Album('s_album1', 2019, 'Indie rock', artist1)
john_album1 = Album('j_album1', 2018, 'Alternative rock', artist2)
john_album2 = Album('j_album2', 2017, 'Heavy metal', artist2)
steve_song1 = Song('s_song1', artist1, [artist2], 2019, 180, steve_album1)
steve_song2 = Song('s_song2', artist1, [artist2], 2019, 220)
john_song1 = Song('j_song1', artist2, [artist1], 2017, 150, john_album1)
john_song2 = Song('j_song2', artist2, [artist1], 2018, 300, john_album2)
john_song3 = Song('j_song3', artist2, [artist1], 2019, 180, john_album1)
# Exception:
steve_song3 = Song('s_song3', artist1, [artist2], 2019, 210, john_album1)
# print(artist1.albums)
# print(artist2.albums)
# print(steve_album1.songs)
# print(john_album1.songs)
# print(artist1.songs)
# print(artist2.songs)
# print(john_album1.duration)