Super Sale (Code Coach)
All the text cases but test case 4 are correct. And text case 4 is locked, can anyone tell me what is wrong: import numpy as np # Introduced numpy as np def savings(x): x = x.split(",") # This splits the input into a list # We get the index of the maximum value and remove the value from the list cost = x.index(max(x)) expensive = float(x.pop(cost)) # Then introduce it into a variable # We created variables initial_price and discounted_price initial_price = expensive discounted_price = expensive # We then iterate over the remaining items in the list for rem in x: initial_price += float(rem) # Added them to the initial discounted_price += float(rem) * 0.7 # discounted them b4 adding tax = (initial_price - discounted_price) * 1.07 # We subtracted the price to get savings and added tax(7%) print(int(np.floor(tax))) purchase = input() savings(purchase) Also would appreciate it if you could make it cleaner