Question: Python Assignment (Code in Python Please) - Please pay attention to details [Will upVote if correct] Please explain your code and show output The goal

Python Assignment (Code in Python Please) - Please pay attention to details [Will upVote if correct]

Please explain your code and show output

The goal of this particular task is to create a song playlist. Each playlist contains a number of songs and/or albums

The below items is to be coded into each class: 1) There are 4 classes: Song, Album, Artist and Playlist with the init method 2) A Song has a title, artist, album it belongs to and track_number; 3) An Album has a title, artist, year, track list of songs; 4) An Artist has a name, albums list and songs list; A Playlist has a name and a songs list 5) Songs can be inserted to an album with each song having a track number 6) Songs can be inserted or deleted from a Playlist 7) Each song and album must be associated with an artist

In the main line of code, answer questions related to specific questions raised. """

#4A #define 4 classes and associated methods based on above problem description class Song: def __init__(self, title, artist, album, track_number): pass

class Album: def __init__(self, title, artist, year): pass def add_track(self, title, artist=None): pass

def __str__(self): pass class Artist: def __init__(self, name): pass def add_album(self, album): pass

def add_song(self, song): pass class Playlist: def __init__(self, name): pass

def add_song(self, song): pass #Make a Band, album object - add song tracks to the album band1 = Artist("Bob's Awesome Band") album = Album("Bob's First Single", band1, 2013) album.add_track("A Ballad about Lecturing") album.add_track("A Ballad about Lecture+Programming (dance remix)") album.add_track("A Third Song to Cry For")

band2 = Artist("Star's Band") album2 = Album("Star's First Single", band2, 2018) album2.add_track("A Karoake Song on Car Racing") album2.add_track("A Poetic Song") album2.add_track("Down to Earth")

album3 = Album("Bob's Second Attempt", band1, 2017) album3.add_track("Really Bad") album3.add_track("Done Bad (dance remix)") album3.add_track("A fifth Song to Cry For")

#4B #write code to print the album contents

#4C #write code to print the album contents using the str method

#4D #write code to print the playlist contents

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!