#write a program that reads the number of items #you purchased in the grocery store and the price for #each item. The program finds the total purchase and #the average price per item def main(): n=int(input("enter number of items ")) sum=0 counter=1 while(counter<=n): price=float(input("enter item price ")) sum = sum + price counter=counter+1 if(n>0): average=sum/n print("total price ", sum) print("average item price ", average) else: print("you didn't buy any items") main()