subject

The following example demonstrates a program that uses 3 levels of nested dictionaries to create a simple music library. The following program uses nested dictionaries to store a small music library. Extend the program such that a user can add artists, albums, and songs to the library. First, add a command that adds an artist name to the music dictionary. Then add commands for adding albums and songs. Take care to check that an artist exists in the dictionary before adding an album, and that an album exists before adding a song. music = {
'Pink Floyd': {
'The Dark Side of the Moon': {
'songs': [ 'Speak to Me', 'Breathe', 'On the Run', 'Money'],
'year': 1973,
'platinum': True
},
'The Wall': {
'songs': [ 'Another Brick in the Wall', 'Mother', 'Hey you'],
'year': 1979,
'platinum': True
}
},
'Justin Bieber': {
'My World':{
'songs': ['One Time', 'Bigger', 'Love Me'],
'year': 2010,
'platinum': True
}
}
}

#complete/edit code given below:

# Get user input

# While user input != 'exit'
# ...

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:20
Write a select statement that returns product name, customer first name, customer last name, channel description, and amount sold for all the sales. make sure to returns sales even if there is no information on the customer, product, or channe
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
What does a cascading style sheet resolve a conflict over rules for an element? a. the rule affecting the most content wins b. the rule affecting the most content loses c. the rule with the most specific selector loses d. the rule with the most specific selector wins
Answers: 2
question
Computers and Technology, 22.06.2019 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Lakendra finished working on her monthly report. in looking it over, she saw that it had large blocks of white space. what steps could lakendra take to reduce the amount of white space?
Answers: 3
You know the right answer?
The following example demonstrates a program that uses 3 levels of nested dictionaries to create a s...
Questions
question
English, 13.09.2021 23:10
question
Mathematics, 13.09.2021 23:10
Questions on the website: 13722367