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
A(n) ____________________ stores copies of data or programs that are located on the hard drive and that might be needed soon in
Katarina [22]
Https://m.youtube.com/watch?v=d-5dc8CuOvw
6 0
3 years ago
9. These particular machines can be decentralized.
shusha [124]

Answer:

A, B

Explanation:

Because the desktop computer and the printers are decentralized, they're connected with another noce in a company.. So I suppose that the Risograph and photocopier isn't decentralized.

4 0
3 years ago
What is the code for loading image in matlab
MA_775_DIABLO [31]

Answer: Using imread command

Explanation:

For loading images in matlab we can use the imread command. Some example regarding how to use the code is as follows:

A = imread('ball.tif');

Here suppose the image file name is saved as ball and is in tif format. Here the image is stored in an array named A.

We can view the image using

imshow(A);

7 0
4 years ago
The benefits associated with AAA are increased security, increased control over the network, and the capability of auditing your
MrRissso [65]

Answer:

The answer is letter A.

Explanation:

The statement is true. The benefits associated with AAA are increased security, increased control over the network, and the capability of auditing your network.

6 0
4 years ago
Refer to the exhibit. A network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transact
Mnenie [13.5K]

Answer:

Binary file.

Explanation:

                           In this case, the network security analyst is using the Follow TCP Stream feature in Wireshark to rebuild the TCP transaction. However, the transaction data seems indecipherable. The explanation for this is that the TCP transaction file is a Binary File and because of this the network secuirty analyst is unable to decipher the transaction file.

                           The solution for this is to convert the binary file into text file which is human readable.

3 0
3 years ago
Other questions:
  • What is the left are if a slide in a presentation called
    15·1 answer
  • Write a function named firstLast2 that takes as input an array of integers and an integer that specifies how many entries are in
    14·1 answer
  • What term is used to describe a shared database of domain users, groups, computers, resources, and other information, along with
    14·1 answer
  • The best way to help prevent a system from a worm attack is to use anti-virus software anti-malware software a firewall a router
    12·1 answer
  • Write the Stats method record that takes a test score and records that score in the database. If the score already exists in the
    15·1 answer
  • Users who are connecting to an NLB cluster have been complaining that after using the site for a few minutes they are prompted t
    15·1 answer
  • Initialized the variable with the value 0
    11·2 answers
  • Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
    9·1 answer
  • ( BRAINLIEST) <br> Name 2 input devices and 2 output devices on a smart phone.
    12·1 answer
  • How many 3 byte sequences contain at least five consecutive 0-bits
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!