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.
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbb7bc7a6-31dc-4260-a709-54a058cd3d65%2Fd888340a-cd64-456f-a45c-0bff857134e0%2Fywahvok_processed.jpeg&w=3840&q=75)
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):](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fbb7bc7a6-31dc-4260-a709-54a058cd3d65%2Fd888340a-cd64-456f-a45c-0bff857134e0%2Fw33hlh_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
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)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education