Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def profitLoss(n,p):
- profit = []
- selling = []
- total = 0
- for product in p:
- a,x,y = product
- profit.append(a + (a * (x/100)))
- selling.append(profit[-1] - (profit[-1] * (y/100)))
- total += a
- ans = int(total - sum(selling))
- if ans > 0 :
- print("Loss",ans)
- else:
- print("Profit",abs(ans))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement