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]
2 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]2 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 line of code will create an instance of the pet class?
Sunny_sXe [5.5K]

Answer:

myPetA = pet(self, 'dog', 'Spot')

Explanation:

I mite be wrong

8 0
2 years ago
Read 2 more answers
Select the correct answer. Which statement is true about the guardian archetype?
kobusy [5.1K]

Answer:

They assist the hero in difficult situations

Explanation:

because its right

3 0
2 years ago
The IT director instructed the systems administrator to build a server to support the accounting department's file growth. The I
Mamont248 [21]

Answer:

Option (C) FAT32 File System Type

Explanation:

  • FAT32 File System Type cannot be encrypted by the accounting users.
  • FAT stands for File Allocation Table. It is a file system architecture.
  • The File Allocation Table is an index table which contains the details about each cluster ( disk storage space ).
  • By traversing the File Allocation Table, the operating system gets the details the file ( where it is located ) and the size of the file.
  • The FAT32 file system contains more number of possible clusters.
  • In this system, 32 bits are used to store the total number of possible clusters.
  • In FAT32 file system, the transparent encryption is not supported.
  • So, option (C) is correct.
  • All other options are wrong options.
3 0
3 years ago
NEED HELP NOW 25 POINTS WILL MARK BRAINLIEST!!!
erastova [34]
The answers are:
C
A
Hope it helps :)
6 0
2 years ago
Read 2 more answers
How to assign some object key values to other name react const.
notsponge [240]

Props are an ordinary object of React that follow the immutable properties. This simply means that you cannot change their value throughout the component. Props and states are in the form of an object which contains the number of key value pairs that could be used to render the value of the objects

8 0
2 years ago
Other questions:
  • Which of the following is another name for cinematographers? (Select all that apply). lighting specialists production manager di
    8·1 answer
  • un diagrama de flujo donde se gana una partida de ajedrez teniendo en cuenta los movimientos de la otra persona
    8·1 answer
  • Match the element of a presentation program to its description
    11·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • Can someone please help me? I have no clue what any of this is and how I'm going to find out 15 examples of these. It's due some
    5·1 answer
  • Whats my screen name?
    9·2 answers
  • Systems Software, Inc., is introducing a new piece of sophisticated graphics software. A recently hired writer has been assigned
    8·1 answer
  • Isa wants to find out if his co-worker Alexis is available for an event on Wednesday, February 10th. Which calendar
    12·1 answer
  • Fwee Pwoints Fwor You
    11·2 answers
  • 9
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!