-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08.08.py
More file actions
executable file
·37 lines (31 loc) · 817 Bytes
/
Copy path08.08.py
File metadata and controls
executable file
·37 lines (31 loc) · 817 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
31
32
33
34
35
36
37
#preparing the prompts for further usage
prompt_0 = "Please, specify the title: "
prompt_1 = "Please, specify the artist: "
prompt_2 = "Please, specify the number of tracks: "
#end
#function to make the album
def make_album(title, artist, tracks=None):
album_info = {
'artist': artist.title(),
'title': title.title()
}
if tracks:
album_info['tracks'] = tracks
return album_info
#end
#make the query for interactions
def album_query():
tracks = input(prompt_2)
result = make_album(title, artist, tracks)
print(result)
#how to break the cycle
smsg = "Enter 'quit' at any time to stop."
print(smsg)
while True:
title = input(prompt_0)
if title == 'quit':
break
artist = input(prompt_1)
if artist == 'quit':
break
album_query()