Question: NEED HELP WITH THIS IN PYTHON #The following script defines a list of customer orders. Each item in the list is a tuple containing the

NEED HELP WITH THIS IN PYTHON

#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))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!