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
What is heaven backwards?
sweet-ann [11.9K]
It is Nevaeh backwards hope that helps! :3 and feel free to pm me if you have anymore questions! :3
5 0
3 years ago
Read 2 more answers
Minerals that contain the elements silicon and oxygen are called ______.
mojhsa [17]
Silcates are minerals with silicon bonded with oxygen.
7 0
3 years ago
What file can you edit on a linux system to configure shared folders using samba?
TiliK225 [7]

/etc/samba/smb.conf is the file you can edit on a linux system to configure shared folders using samba.

<h3>What is a Linux system ?</h3>
  • A Unix-like operating system (OS) for desktops, servers, mainframes, mobile devices, and embedded devices, Linux is open source and user-developed.
  • One of the most broadly supported operating systems, it is supported on virtually all popular computing platforms, including x86, ARM, and SPARC.
  • Windows OS is a for-profit operating system, whereas Linux is an open-source alternative. In contrast to Windows, which lacks access to the source code, Linux allows users to modify the code as needed.
  • Applications, interfaces, programs, and software are all produced through Linux programming. Desktops, real-time apps, and embedded devices frequently employ Linux code.
  • Programmers can learn about the Linux kernel for free online, enabling them to use, modify, and develop Linux without restriction.

Learn more about linux system refer to :

brainly.com/question/25480553

#SPJ4

6 0
1 year ago
Hey plz help me with this<br>What is malware short for?​
soldier1979 [14.2K]

Answer:

Malware is the collective name for a number of malicious software variants, including viruses, ransomware and spyware. Shorthand for malicious software, malware typically consists of code developed by cyberattackers.

Explanation:

4 0
2 years ago
The proof that the Clique problem is NP-complete depends on a construction given in Theorem 34.11 (p. 1087), which reduces 3SAT
ki77a [65]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the step by step explanation to the question above.

5 0
3 years ago
Other questions:
  • Briefly describe "SoftwareEngineering Framework". Do provide examples and diagrams wherenecessary.
    15·1 answer
  • Shania has started a new job as an app developer. Her first task was to make an old app designed for Android available on other
    6·1 answer
  • What's one way to engage teens in technology?
    8·1 answer
  • For any two documents x and z, define k(x, z) to equal the number of unique words that occur in both x and z (i.e., the size of
    15·1 answer
  • Employees don't have to comply with PPE requirements if they feel the PPE isn't necessary for the particular task they performed
    14·2 answers
  • Which of the following attack is a threat to confidentiality?
    10·1 answer
  • Given two Strings String s1 = "11223351638791377189728193"; String s2 = "983763978669976862724569282405742578"; and String varia
    15·1 answer
  • Que es el sistema persona producto?​
    8·1 answer
  • I need a computer science help.....and I rlly want it right now...this the question
    10·1 answer
  • Greenpeace used "Mister Splashy Pants" to:
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!