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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Write pseudocode to represent the logic of a program that allows the user to enter a value. the program multiplies the value by 10 and outputs the result.
Answers: 1
question
Computers and Technology, 25.06.2019 03:00
Between 1932 and 1938, chester carlson developed a process that enabled a "picture" of a document to be taken and then have it reproduced on another
Answers: 1
question
Computers and Technology, 25.06.2019 05:10
Assume that two parallel arrays have been declared and initialized: healthoption an array of type char that contains letter codes for different healthcare options and annual cost an array of type int. the i-th element of annual cost indicates the annual cost of the i-th element of healthoption. in addition, there is an char variable, best2.write the code necessary to assign to best2 the health option with the lower annual cost, considering only the first two healthcare options. thus, if the values of healthoption are 'b', 'q', 'w', 'z' and the values of annualcost are 8430, 9400, 7050, 6400 your code would assign 'b' to best2 because 8430 is less than 9400 and is associated with 'b' in the parallel array. (we ignore 'w' and 'z' because we are considering only the first two options.)
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
question
Spanish, 12.01.2021 07:10
question
Biology, 12.01.2021 07:10
question
English, 12.01.2021 07:10
question
Mathematics, 12.01.2021 07:10
Questions on the website: 13722367