Ask Question

Assume there is a variable, album_artists, that is associated with a dictionary that maps albums to performing artists. Write a statement that inserts the key/value pair: "Live It Out"/"Metric"

+1
Answers (1)
  1. 19 June, 02:14
    0
    Following are the program in the Python Programming Language.

    #define function.

    def album ():

    #set dictionary data type variable

    album_artists = dict ()

    #Initialize the key and value in the dictionary

    album_artists["Live It Out"] = "Metric"

    #dispaly the dictionary.

    print (album_artists)

    #call the function

    album ()

    Output:

    {'Live It Out': 'Metric'}

    Explanation:

    Here, we define function "album () " and inside the function.

    Set dictionary data type variable "album_artists" through built-in function "dict () ". Initialize the key and the value inside the dictionary type variable "album_artists". Then, print the following dictionary through the print () function.

    Finally, call the following function "album () ".
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assume there is a variable, album_artists, that is associated with a dictionary that maps albums to performing artists. Write a statement ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers