Answered step by step
Verified Expert Solution
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 keyvalue pairs that consists of a musical database. The keyvalue pairs should consist of Artist Name: Song Names pattern.
For example, EACH artist name key will have an associated list of of their top songs value
For a visualization of what this would look like, I have provided an example below:
XYZ EltonJohn: rocket manyour songbenny and the jets
The database you create will be a simulated Billboard Top the represents the musical genrelist 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
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 keyvalue sequence of only artistssong name list pair artist list of songs This action should use LISTS and then PAIR them together. For example, the lists below will need to be merged into dictionary
numbers
letters xabyolcfz
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started