Write a line of code that creates a dictionary

Assignment Help Basic Computer Science
Reference no: EM132493624

Question 1: In the main, Please write a line of code that creates a dictionary called my_dict that maps the key 'chocolate' to the list ['chip', 'cake']. In put a line of code the adds the item 'ice cream' to the list associated with the key 'chocolate'. Given a variable sweet, then write an if-else block that checks to see if sweet is a key in the dictionary and if it is, adds 'mousse' to the list associated with the key; other wise it creates a new key-value pair with sweet as the key and a list containing 'mousse' as the value.

Question 2: Please write a function called get_keys that takes a dictionary and a value as arguments. It returns a list of every key that maps to the given value.

Reference no: EM132493624

Questions Cloud

Build a data a conceptual data model for nna : Using the attributes below to build a data a conceptual data model for NNA and Draw tables for only classes linked to sales cycle
What is the book value after five years : The salvage value will be 10% of the first cost. Using straight line method of depreciation, what is the book value after 5 years?
File management system-database management system : What are the main differences between the file management system and the database management system?
Create and give schedule showing annual depreciation expense : Using the straight-line depreciation method, give a schedule showing annual depreciation expense, accumulated depreciation, and any related calculations
Write a line of code that creates a dictionary : In the main, Please write a line of code that creates a dictionary called my_dict that maps the key 'chocolate' to the list ['chip', 'cake'].
Differenciate a regular subquery and a correlated subquery : Discuss the differences between a regular subquery and a correlated subquery. Provide an example of one or both subqueries. The response must be typed.
Negatives of cloud computing perceived : Why are disadvantages or negatives of cloud computing perceived and not realistic drawbacks?
What are you biggest take aways from the course : What are you biggest take aways from this course? What do you think you will take back to your current job to possibly implement with your team?
Determine the number of preference share issued : Determine the Number of preference share issued, Cost of remaining treasury shares (acquired by purchase) at December 31, 2016

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Iot presentation

Your IT manager to provide an impactful IT-based presentation with an infographic handout for non-technical employees that discusses IoT

  Report from texas transportation institute

Compute the mean and median values for extra travel hours. Based on the values of the mean and median, is the distribution of extra travel hours

  Implement the sub method for the polynomial class

The implementation of the Polynomial mul method is O(n2 ) in the worst case. Design and implement a more efficient solution for this operation.

  American marketing association publication

Read the article titled Mobile Mobile Mobile (https://www.ama.org/publications/MarketingNews/Pages/Mobile-Mobile-Mobile.aspx) by Jeffrey Hayzlett from the American Marketing Association publication called Marketing News. The article outlines some ..

  Find maximum multiplier paths between all pairs of nodes

Consider the maximum capacity path problem defined in Exercise 4.37. Modify the Floyd-Warshall algorithm so that it finds maximum capacity paths between all pairs of nodes.

  Depends heavily on business-related travel

1) How do you think communication and collaboration would evolve? 2) How do you think these communication technologies will affect the travel industry which depends heavily on business-related travel?

  List three reason that a company may decide

List three reason that a company may decide to either build in-house or use in-house resources on a project.

  Bim consultants-what is your assessment of the situation

What is your assessment of the situation? What advice would you provide to the board of Bim Consultants?

  Does it work correctly if the collection is empty

Rewrite the list All Files method in the Music Organizer class from music-organizer-v3 by using a do-while loop rather than a for-each loop. Test your solution carefully. Does it work correctly if the collection is empty?

  List three examples of discrete output devices

What types of field input devices are suitable for use with them?

  Discuss these elements using an example

What elements should be considered to be included in any recursive method? Discuss these elements using an example (code required) of a recursive method written by you or taken from Web. Try choosing one different from that of any posted thus far.

  What is the probability of selecting a random sample

What is the probability of selecting a random sample of n = 4 students with an average age greater than 23? (Careful: This is a trick question!!)

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd