9/6/22

Let's go shopping

 You’re making a shopping cart program.

The shopping cart is declared as a list of prices, and you need to add functionality to apply a discount and output the total price.

Take the discount percentage as input, calculate and output the total price for the shopping cart.

cart = [15, 42, 120, 9, 5, 380]

discount = int(input())

total = 0

for x in cart:

    p = x * discount 

    q = p/100

    t= x - q

    total += t


print (total )

Blog Archive