while True:
    ItemID = Inventory.readline().strip()
    if ItemID == "":
        break
    else:
        ItemDesc = Inventory.readline().strip()
        ItemPrice = float(Inventory.readline().strip())
        TotalPrice += ItemPrice
        NumberOfItems += 1
        ItemAverage = TotalPrice / NumberOfItems
        
        print(ItemID + " is " + ItemDesc + " and is priced at: " + str(ItemPrice))
    
Inventory.close()

print("Average list price is : " + str(ItemAverage))
BP2500 is 3-PERSON TENT and is priced at: 75.0
BP1000 is LOUNGE CHAIR and is priced at: 50.0
BP3000 is PROPANE HEATER and is priced at: 149.0
BP0900 is HIKING BOOTS and is priced at: 120.0
BP0950 is BACKPACK and is priced at: 100.0
BP3050 is GPS TRACKER and is priced at: 130.0
Average list price is : 104.0
[Finished in 0.3s]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top