Display the list in the following format: ARTIST NAME(album name, track #): song title, where • the artist name is displayed in ALL CAPS, • the album name and track # follow immediately inside parenthesis, • followed by a colon, • followed by the song title (in the title format). The song titles should line up.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In python language, including print(song)

Starter Pack (e03-songs.py)
Display this interesting collection of music in a pretty format.
Use the string methods: title, upper, ljust
See expected output
def displaySong(song):
# TODO: make this look nicer, note song is a list.
print(song)
# list of a list of songs ( artist, title, album, track # )
# do not modify the song 1ist, use string formatting in the displaySong function
music_collection = [
["Sturgill Simpson', 'Poor Rambler', 'High Top Mountain', 11],
['Cherish', 'Unappreciated', 'Unappreciated', 2],
['Townes Van Zandt', "Waitin' Around to Die", "For the Sake of the Song",
['Kendrick Lamar', 'Money Trees', 'good kid, m.A. A.d city (Deluxe)', 5]
, 5]
print("Music Library".center (80, '='))
for song in music_collection:
displaySong(song)
Expected Output
whitespace is important here!
====Music Library====
STURGILL SIMPSON(High Top Mountain, 11):
CHERISH(Unappreciated, 2):
TOWNES VAN ZANDT (For the Sake of the Song, 5):
KENDRICK LAMAR(good kid, m.A.A.d city (Deluxe), 5):
Poor Rambler
Unappreciated
Waitin Around To Die
Money Trees
Transcribed Image Text:Starter Pack (e03-songs.py) Display this interesting collection of music in a pretty format. Use the string methods: title, upper, ljust See expected output def displaySong(song): # TODO: make this look nicer, note song is a list. print(song) # list of a list of songs ( artist, title, album, track # ) # do not modify the song 1ist, use string formatting in the displaySong function music_collection = [ ["Sturgill Simpson', 'Poor Rambler', 'High Top Mountain', 11], ['Cherish', 'Unappreciated', 'Unappreciated', 2], ['Townes Van Zandt', "Waitin' Around to Die", "For the Sake of the Song", ['Kendrick Lamar', 'Money Trees', 'good kid, m.A. A.d city (Deluxe)', 5] , 5] print("Music Library".center (80, '=')) for song in music_collection: displaySong(song) Expected Output whitespace is important here! ====Music Library==== STURGILL SIMPSON(High Top Mountain, 11): CHERISH(Unappreciated, 2): TOWNES VAN ZANDT (For the Sake of the Song, 5): KENDRICK LAMAR(good kid, m.A.A.d city (Deluxe), 5): Poor Rambler Unappreciated Waitin Around To Die Money Trees
Write a python program, using string methods, to
print the list of songs out in a pretty format. The list is
formatted as:
• first element is the artist name,
• second element is the song title,
• third element is the album name,
• and last element is the track #.
Display the list in the following format: ARTIST
NAME(album name, track #): song title, where
• the artist name is displayed in ALL CAPS,
• the album name and track # follow immediately
inside parenthesis,
• followed by a colon,
• followed by the song title (in the title format). The
song titles should line up.
The following string methods will be useful for solving
this problem:
• ljust().
upper().
title().
Starter Pack (e03-songs.py)
Display this interesting collection of music in a pretty format.
Use the string methods: title, upper, ljust
See expected output
def displaySong(song):
# TODO: make this look nicer, note song is a list.
print(song)
# list of a list of songs ( artist, title, album, track # )
# do not modify the song list, use string formatting in the displaySong function
music_collection = [
['Sturgill Simpson', 'Poor Rambler', 'High Top Mountain', 11],
['Cherish', 'Unappreciated', 'Unappreciated', 2],
['Townes Van Zandt', "Waitin' Around to Die", "For the Sake of the Song", 5]
['Kendrick Lamar', 'Money Trees', 'good kid, m.A.A.d city (Deluxe)', 5]
print("Music Library".center(80, '='))
for song in music_collection:
displaySong(song)
Expected Output
whitespace is important here!
========Music Library====
====:
STURGILL SIMPSON(High Top Mountain, 11):
CHERISH(Unappreciated, 2):
TOWNES. VAN. ZANDIC For the Sake of the Song.
Poor Rambler
Unappreciated
Waitin Around To Die.
5):
Transcribed Image Text:Write a python program, using string methods, to print the list of songs out in a pretty format. The list is formatted as: • first element is the artist name, • second element is the song title, • third element is the album name, • and last element is the track #. Display the list in the following format: ARTIST NAME(album name, track #): song title, where • the artist name is displayed in ALL CAPS, • the album name and track # follow immediately inside parenthesis, • followed by a colon, • followed by the song title (in the title format). The song titles should line up. The following string methods will be useful for solving this problem: • ljust(). upper(). title(). Starter Pack (e03-songs.py) Display this interesting collection of music in a pretty format. Use the string methods: title, upper, ljust See expected output def displaySong(song): # TODO: make this look nicer, note song is a list. print(song) # list of a list of songs ( artist, title, album, track # ) # do not modify the song list, use string formatting in the displaySong function music_collection = [ ['Sturgill Simpson', 'Poor Rambler', 'High Top Mountain', 11], ['Cherish', 'Unappreciated', 'Unappreciated', 2], ['Townes Van Zandt', "Waitin' Around to Die", "For the Sake of the Song", 5] ['Kendrick Lamar', 'Money Trees', 'good kid, m.A.A.d city (Deluxe)', 5] print("Music Library".center(80, '=')) for song in music_collection: displaySong(song) Expected Output whitespace is important here! ========Music Library==== ====: STURGILL SIMPSON(High Top Mountain, 11): CHERISH(Unappreciated, 2): TOWNES. VAN. ZANDIC For the Sake of the Song. Poor Rambler Unappreciated Waitin Around To Die. 5):
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education