# Sales Analysis # # This program inputs the sales for five # days and outputs the total, average, and the # portion of the total each day's sales represents # # Written by Oscar Meyer # 10 November 2011 def analyze(): dayNames = ["Monday ", "Tuesday ","Wednesday","Thursday ","Friday "] daySales = [0.0,0.0,0.0,0.0,0.0] total = 0.0 for day in range(5): daySales [day] = input ("Enter sales for " + dayNames [day] + ">>") total = total + daySales [day] # create report print "\n\n\n===============Daily Sales Analysis================" print " Day\t\t Sales\tPortion\n" for i in range(5): dayPortion = daySales[i]*100/total print dayNames [i] + "\t" + \ "%0.2f"%daySales[i]+"\t\t%0.4f"%dayPortion print "\nTotal\t%0.2f"%total+"\nAverage\t%0.2f"%(total/5) analyze()