subject

#The following script defines a list of customer orders. Each item in the list is a tuple containing the name of the item, the number requested, and the price per item. #Fill in just the process_order function below without changing any other code. This function should remove one of the elements of the order list and print a nice message about it each time through the loop. Finally, make sure that the final print statement correctly displays the total price for the entire list.
#Example:
#You filled an order for 1 antacid for a total of $5.33
#You filled an order for 3 sour bites for a total of $6.99
#You filled an order for 1 gummy bears for a total of $1.99
#You filled an order for 4 oranges for a total of $12.88
#Total price: $27.19
total = 0
def process_order(x_list):
# YOUR CODE HERE
raise NotImplementedError()

# DO NOT CHANGE ANY OF THE CODE BELOW HERE #

x = [("oranges", 4, 3.22),("gummy bears",1,1.99),("sour bites", 3, 2.33), ("antacid", 1, 5.33)]
while(len(x)>0):
process_order(x)
print("Total price: ${:.2f}".format(total))

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, loveworld3798
When working with a team you should always do the following, except? question 3 options: be dependable and trustworthy be sensitive to others feelings do your fair share critique members of the group
Answers: 2
image
Computers and Technology, 24.06.2019 12:30, tragicteekaay
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
image
Computers and Technology, 24.06.2019 12:40, kanga06
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
image
Computers and Technology, 24.06.2019 14:30, ari313
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
#The following script defines a list of customer orders. Each item in the list is a tuple containing...

Questions in other subjects:

Konu
History, 06.07.2019 13:30