Course Solutions Uncategorized (Solved) : List Prices Prices Subtotal 00 Iterate 5 Items Range 5 Get Price Value Float Input Enter P Q34949492 . . . .

(Solved) : List Prices Prices Subtotal 00 Iterate 5 Items Range 5 Get Price Value Float Input Enter P Q34949492 . . . .

 

  • #List of prices
    prices = []
    sub_total = 0.0
    #Iterate for 5 items
    for i in range(5):
    #Get the price
    value = float( input(“Enter the price of item #” + str(i+1) + “:”))
    #compute the sub total
    sub_total = sub_total + value
    #add the value to the list
    prices.append(value)
    #compute the tax on the sub total @ rate of 7.25%
    tax = sub_total * (7.25/100)
    #Now, compute the total price
    total_price = sub_total + tax
    print(“Sub total: ” + str(sub_total))
    print(“Tax: {:0.2f}”.format(tax))
    print(“Total: {:0.2f}”.format(total_price))

    //Output

    ф bill.py py ь ф bill.py b #List of prices 3 prices [ 4 sub total-0.0 6 #Iterate for 5 items 7 for i in range (5): #Get the p

    ф bill.py py ь Ф bill.py b #List of prices 3 prices=[] 4 subtotal 0.0 #Iterate for 5 items for i in range (5): 7 #Get the pri

    use

    OR

    PayPal Gateway not configured

    OR

    PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post