Question: Can someone please explain how I should go about this python program and provide an example? Im not sure how this would all fit together

Can someone please explain how I should go about this python program and provide an example? Im not sure how this would all fit together and how I should make it write to a txt file. Need some guidence. As the question says im trying to use classes not something else.Thanks for your time.Can someone please explain how I should go about this python program

Create a song class Attributes 1. Title 2. Band members: a dictionary with name as the key and instrument as the values. 3. (Highest place on the charts. Methods 1. init Has a filepointer as an optional parameter. If filepointer is None have the user input the attributes. If the filepointer is not None input the song from the file. 2. str Output the attributes in a nice way 3. save Save a song to a file, the filepointer should be a parameter. Create an album class Attributes 1. Title 2. Year 3. Producer 4. Songs a list of songs each of which are of type class song Methods 1. init Has a filepointer as an optional parameter. If filepointer is None have the user input the attributes. If the filepointer is not None input the album from the file. In both cases, when you input a song make sure to use the songs method for input The song attribute should be an optional para If the value is None keep inputting songs until the user is done 2. str Output the attributes of the album in a nice way. 3. save saves the entire album to a file, makes use of the song.save attribute for the songs. The filepointer is a parameter

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!