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
They are correct? thank you!
vredina [299]

Answer:

<em>Yes</em><em> </em><em>they</em><em> </em><em>are</em><em> </em><em>correct</em><em>.</em><em> </em><em>welcome</em><em>.</em><em>.</em><em>.</em><em>.</em>

8 0
3 years ago
84.6% complete question a network administrator is installing a device that uses redundant array of independent disks (raid) tec
Alja [10]

The device that this network administrator is most likely installing in the infrastructure is a Network Attached Storage (NAS).

<h3>What is a Network Attached Storage (NAS)?</h3>

A Network Attached Storage (NAS) can be defined as a file-dedicated storage device that is designed and developed to enable multiple end users and other heterogeneous client devices to store, share and retrieve data anywhere from a centralized disk, especially through a network.

In this context, we can infer and logically conclude that a Network Attached Storage (NAS) is the device that this network administrator is most likely installing in the infrastructure because it doesn't require licensing and the data stored on it at the file level can be accessed anywhere.

Read more on Network Attached Storage here: brainly.com/question/14456295

#SPJ1

3 0
2 years ago
Please explain a function in coding.
Julli [10]

Answer:

it is organized reusable code to perform some action

8 0
3 years ago
Which RAID configuration, known as byte-striped with error check, spreads the data across multiple disks at the byte level with
wel

Considering the computer system technology, the RAID configuration, known as byte-striped with an error check, and spreads the data across multiple disks at the byte level with one disk dedicated to parity bits is known as <u>RAID Level 5.</u>

<h3>What is the RAID Level 5?</h3>

RAID Level 5 is the Redundant Array of Inexpensive (or Independent) Disks Level 5. RAID Level 5 works on strips to transfer data over multiple disks in an array.

RAID Level 5 is also known to record information, with the ability to withstand numerous failures.

<h3>Other types of Redundant Array of Inexpensive (or Independent) Disks</h3><h3 />
  • RAID level 0
  • RAID level 1
  • RAID level 2
  • RAID level 3
  • RAID level 4

Hence, in this case, it is concluded that the correct answer is RAID Level 5.

Learn more about RAID configuration here: brainly.com/question/9305378

8 0
3 years ago
Explain the changing of work and enterprises due to the availability of EFTPOS?
kolbaska11 [484]
Who benefits from piracy?



5 0
3 years ago
Other questions:
  • Your computer crashed, and you lost many personal and work-related files. You just got a new computer, but you are now much more
    8·2 answers
  • What is the purpose of a register in a CPU? Describe three types of registers.
    12·1 answer
  • What piece of software tells the operating system how to use a specific hardware device? a. User interface b. System service c.
    14·1 answer
  • While inserting images, the Picture command is usually used to insert photos from a digital camera, and the Clip Art command is
    7·2 answers
  • One tool of Lean that is a container, card, or visual limit that signals when work needs to be done or replenishment needs to be
    13·1 answer
  • What is the purpose of creating a primary key in a database
    14·1 answer
  • Chapter
    15·1 answer
  • Convert the binary number 100101 to decimal. Show your solution
    11·1 answer
  • Why is translator required ​
    11·1 answer
  • Hiding/masking personal identifiers from a data set, so that the data set can never identify an individual, even if it is correl
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!