1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Firdavs [7]
3 years ago
15

The add_prices function returns the total price of all of the groceries in the dictionary. Fill in the blanks to complete this f

unction (python):def add_prices(basket): # Initialize the variable that will be used for thecalculation total = 0 # Iterate through the dictionary items for ___: # Add each price to the totalcalculation # Hint: how do you access thevalues of # dictionary items? total += ___ # Limit the return value to 2 decimal places return round(total, 2)groceries = {"bananas": 1.56, "apples": 2.50, "oranges": 0.99,"bread": 4.59, "coffee": 6.99, "milk": 3.39, "eggs": 2.98, "cheese":5.44}print(add_prices(groceries)) # Should print 28.44
Computers and Technology
1 answer:
Vlada [557]3 years ago
8 0

Answer:

def add_prices(basket):

 

   total = 0

   for items in basket.values():

       total += items

   return round(total, 2)

groceries = {"bananas": 1.56, "apples": 2.50, "oranges": 0.99,"bread": 4.59, "coffee": 6.99, "milk": 3.39, "eggs": 2.98, "cheese":5.44}

print(add_prices(groceries)) # Should print 28.44

Explanation:

The python dictionary is a data structure that stores items of data as a key-value pair. The keys and values can be listed separately using the keys() and values() built-in function.

The program above uses a for loop statement to iterate over the values of the groceries dictionary to return the total sum of the values.

You might be interested in
Which privacy protection uses four colors to indicate the expected sharing limitations that are to be applied by recipients of t
levacccp [35]

The Traffic Light Protocol (TLP) was created in order to facilitate greater sharing of information. TLP is a set of designations used to ensure that sensitive information is shared with the appropriate audience. It employs four colors to indicate expected sharing boundaries to be applied by the recipient(s).

cisagov

3 0
3 years ago
You want to calculate a bonus if the sold price was at least equal to the listing price, and if the house sold within 30 days af
erma4kov [3.2K]

Answer:

Following are the solution to the given question:

Explanation:

Please find the following Excel form for calculating the bonus as required. Please ensure the equation is duplicated even so, with the sign "=." It is possible to insert this formula into cell L12. Then cut/paste the cell into other L12:L39 cells.

=IF(AND(G12/F12 \geq \$L \$7,J12 \leq \$L\$8)=TRUE,\$L\$9,0)

The mixed microbial reference here is used in L7, L8, and L9 so these cell references are not moved whenever the formula is copied to L12:L39.

Please verify that whenever the copy has also been copied, the cell formula appears beneath in each cell.

It must be as below in L12.

=IF(AND(G12/F12 \geq \$L\$7,J12\leq \$L\$8)=TRUE,\$L\$9,0)

It must be as follows in L13.

=IF(AND(G13/F13\geq \$L\$7,J13\leq \$L\$8)=TRUE,\$L\$9,0)

and so on.

8 0
3 years ago
he World Wide Web Consortium recommends that all style informa- tion about a document should be stored in a separate style sheet
Solnce55 [7]

Answer:

  • Allows the style to be reused across multiple pages, giving the website a consistent look
  • Improved web page load times as the CSS file is only downloaded once

Additional Detail:

The Cascading Style Sheet (CSS) file is used in web pages to define features such as font, color, spacing.

5 0
3 years ago
HELP ME OUT PLEASE!
beks73 [17]

Answer:

c 8

Explanation:

c 8

5 0
3 years ago
These types of utility programs make it possible for people to access multimedia files using their computers.
zysi [14]

Answer:

hi your question lacks the options here is the complete question and option

These types of utility programs make it possible for people to access multimedia files using their computers.

accessibility

communication

entertainment

security

Answer : Entertainment

Explanation:

The Entertainment utility programs make it possible for people to access multimedia files on their computer systems because multimedia files are files containing entertaining contents/data like pictures, videos, music or games .

and all these are for the entertainment purpose of the user of the computer system. the Entertainment utility program ensures direct access to these files. while the other utility programs grants access to different files related to them in the system.

4 0
3 years ago
Other questions:
  • Labor-augmenting technology causes which of the following?(i) The marginal productivity of labor increases.(ii) The marginal pro
    7·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • Which from the following list are an example of productivity software?
    7·2 answers
  • A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considera
    8·1 answer
  • A user creates a GPO. What do you need to do for that user to manage his or her GPO that he or she created?
    12·1 answer
  • What is the name of the process of checking the client's production environment to ensure software and hardware compatibility wi
    5·2 answers
  • Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
    15·2 answers
  • Answer 1 question and get 10 points in return
    10·2 answers
  • Complex scientific research is usually done using?
    5·1 answer
  • Use the writeln() method of the document object to display the current platform in a tag in the webpage. Hint: The platform prop
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!