diff --git a/Chapter_08/8-07_album.py b/Chapter_08/8-07_album.py new file mode 100644 index 0000000..ad2fff8 --- /dev/null +++ b/Chapter_08/8-07_album.py @@ -0,0 +1,17 @@ +# Exercise 8-7 Album +# Learning Objective: Write a function that returns a dictionary of information about an album. + +def make_album(artist_name, album_title, num_tracks=None): + album_info = {'artist': artist_name, 'album': album_title} + if num_tracks: + album_info['number_of_tracks'] = num_tracks + return album_info + +newAlbum = make_album('Korn', "Y'all wanna single", 1) +print(newAlbum) + +newAlbum2 = make_album('Infected Mushroom', 'Classical Mushroom', 9) +print(newAlbum2) + +newAlbum3 = make_album('Outsiders, Menog', 'Psychedelic Liquid') +print(newAlbum3) \ No newline at end of file