Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Premise: Using a dictionary and list, create a set of key / value pairs that consists of a musical database. The key / value pairs

Premise:
Using a dictionary and list, create a set of key/value pairs that consists of a musical database. The key/value pairs should consist of Artist Name: Song Names pattern.
For example, EACH artist name (key) will have an associated list of 3 of their top songs (value).
For a visualization of what this would look like, I have provided an example below:
XYZ {Elton_John: [rocket man,your song,benny and the jets]}
The database you create will be a simulated Billboard Top 15?????(the ???? represents the musical genre/list of your choice). You are free to make this a fictional list or use an actual list that is found on Billboards web site or Spotify account.
Task:
Write a function that uses the dictionary you created and sorts the list alphabetically by artist name. (This must be a function separate from the main function and DOES NOT print anything to the shell think of it as a worker function)
Write a function that returns the total number of artists in your dictionary AS WELL as the sorted list from the previous function above (this should return the value 15).
Write a function that returns only the artist names in your dictionary without the values.
Write a function that returns only the values without the artist names.
Write a function that clears the dictionary and then creates a new key/value sequence of only 5 artists/song name list pair (artist / list of 3 songs). This action should use 2 LISTS and then PAIR them together. For example, the 2 lists below will need to be merged into 1 dictionary
numbers =[1,2,3]
letters =[['x',a,b],['y',o,l],[c,f,'z']]
Write a function that returns both the Keys and Value list of the NEW dictionary.
Delivery:
Submit your final code for evaluation as a Python script (.py) file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions