Question

Dictionaries

1)
Assume there is a variable, nobel_peace_prizes , that is associated with a dictionary that maps years to winners of the Nobel Peace Prize for that year and assume itis up-to-date through the year 2005. Write a statement that adds an entry that maps the key 2006 to "Muhammad Yunus and Grameen Bank" .


2)
Given a variable, us_cabinet , that is associated with a dictionary that maps department names to department heads, replace the value "Gonzalez" with "Mukasey" for thekey "Justice Department"

3)
The variable planet_distances is associated with a dictionary that maps planet names to planetary distances from the sun. Write a statement that deletes the entry forthe planet name "Pluto" .

3 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #6

1)

nobel_peace_prizes[2006]="Muhammad Yunus and Grameen Bank"

2)

us_cabinet["Justice Department"] = "Mukasey"

3)

del planet_distances["Pluto"]

 

 

You're welcome, MyProgrammingLab people :)

source: MyProgrammingLab (self answered)
Add a comment
Answer #1

ez

source: ez
Add a comment
Answer #2

ezzz

Add a comment
Answer #5

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

Add a comment
Answer #7
[REMOVED]
Add a comment
Answer #8
most_recent_novel["J.K. Rawling"]= "Harry Potter and the Deathly Hallows"
source: MyProgrammingLab (self answered)
Add a comment
Answer #9
if 'Pluto' in planet_distances:del planet_distances['Pluto']
source: Study
answered by: M Fadel Agha Alkla
Add a comment
Know the answer?
Add Answer to:
Dictionaries
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • dictionary adding / removal

    Given a variable, unproved_conjectures, that is associated with a dictionary that maps the common names of mathematical conjectures to the years when the conjectures were made, write a statement that deletes the entry for "Fermat's Last Theorem".

  • Given a variable, unproved_conjectures, that is associated with a dictionary that maps the common names of...

    Given a variable, unproved_conjectures, that is associated with a dictionary that maps the common names of mathematical conjectures to the years when the conjectures were made, write a statement that deletes the entry for "Fermat's Last Theorem". In Python.

  • Dictionaries

    1)You are given a variable, wwII_battle_winners , that is associated with a dictionary that maps the names of World War II battles to the victors of WWII battles. Writesome code that associates a sorted list of the battle names that appear as keys in this dictionary with the variable battles .2)The inverse of a map is a new map where the values of the original map become the keys of the new map and the keys become the values. For...

  • For Python 3 MPLS please 1. Given a variable, unproved_conjectures, that is associated with a dictionary...

    For Python 3 MPLS please 1. Given a variable, unproved_conjectures, that is associated with a dictionary that maps the common names of mathematical conjectures to the years when the conjectures were made, write a statement that deletes the entry for "Fermat's Last Theorem". 2. Given a dictionary d, create a new dictionary that reverses the keys and values of d. Thus, the keys of d become the values of the new dictionary and the values of d become the keys...

  • The variable most_recent_novel is associated with a dictionary that maps the names of novelists to their...

    The variable most_recent_novel is associated with a dictionary that maps the names of novelists to their most recently published novels. Write a statement that replaces the value "Harry Potter and the Half-Blood Prince" with the value "Harry Potter and the Deathly Hallows" for the key "J.K. Rawling". In Python

  • 1. Analyze the major challanges USB faced in the last 5 years, in your opinion, what were the cru...

    1. Analyze the major challanges USB faced in the last 5 years, in your opinion, what were the crucial factors in the banks downturn? 2. what are the main triggers to change the banks approach to communication and what is different today regarding the dealings and relationship to its share-and stakeholders? 3. How would you evaluate the constant replacement of the banks chairman and CEO? 4. in view of the future strategy of USB, what are your suggestions in order...

  • 1. Analyze the major challanges USB faced in the last 5 years, in your opinion, what...

    1. Analyze the major challanges USB faced in the last 5 years, in your opinion, what were the crucial factors in the banks downturn? 2. what are the main triggers to change the banks approach to communication and what is different today regarding the dealings and relationship to its share-and stakeholders? 3. How would you evaluate the constant replacement of the banks chairman and CEO? 4. in view of the future strategy of USB, what are your suggestions in order...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT