Question: Open the output file using a with statement. Start a while loop that continues until the user presses Enter ( or Return on a Mac
Open the output file using a with statement.
Start a while loop that continues until the user presses Enter or Return on a Mac for the LP title.
Prompt the user for the following information about each LP:
LP Title: The title of the LPArtists Names: The names of the artistsRegular Price: The regular price of the LP floatDiscount : The discount on the LP during the sale integer
After capturing the details for each LP append the data to a file named lpsale.txt with each piece of data on its own line.
Once the user presses Enter or Return on a Mac for the LP tit
example inputOutput
Enter the album's title: Dionne Warwick's Golden Hits
Enter the artists names: Dionne Warwick
Enter the regular price:
Enter the discount in percent:
Enter the album's title:
Enter the artists names: Taylor Swift
Enter the regular price:
Enter the discount in percent:
Enter the album's title: Meet the Beatles!
Enter the artists names: The Beatles
Enter the regular price:
Enter the discount in percent:
Enter the album's title:
The LP sale data has been successfully stored in lpsale.txt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
