Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def findLowestPrice ( products , discounts ) : total = 0 for product in products: min _ price = float ( ' inf ' )

def findLowestPrice(products, discounts):
total =0
for product in products:
min_price = float ('inf')
for i in product:
price = int(i[01)|I
prices =[]
for j in range(1, len(i)):
val=price
for discount in discounts: if discount[0]==i[j]:
a, b = int (discount[1]), int (discount [
break if a==0:
val=min (val, b)
elif a==1:
val = min (val, round (price-(price*(b/101
elif a==2:
val=min (val, price-b)
prices. append (val)
min_price = min(min_price, sum (prices))
total+=min_price
return total
price = int(i[0])
ValueError: invalid literal for int) with base 10: 's'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Evaluate each expression. (0.1) 3

Answered: 1 week ago