Computers and Technology

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'
# ...

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, brylove603
Pls do you believe that the use of 3d animation has grown in feature films over the last few years? if so, do you think the trend will continue? what are the forces driving this trend?
Answers: 2
image
Computers and Technology, 22.06.2019 08:00, Leggett8152
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
image
Computers and Technology, 22.06.2019 21:00, briannaleiigh
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year school. what is the expected total cost for one year at the local community college if kirk lives at home? what is the expected total cost for one year at the out-of-state school if kirk lives on campus?
Answers: 2
image
Computers and Technology, 24.06.2019 08:00, ineemorehelp
Arah has entered data about football players from team a and team b in a worksheet. she enters names of players from team a with details about each player in different columns of the worksheet. similarly, she enters details of all the players from team b. which option will her view the data for team a and team b in two separate sections after printing? a. page break view b. freeze pane view c. split screen view d. full screen view e. zoom out view
Answers: 1
Do you know the correct answer?
The following example demonstrates a program that uses 3 levels of nested dictionaries to create a s...

Questions in other subjects: