Total Sales Using the attached sale.txt file get the sales ofeach day for the week. The amounts should be stored in a twodimensional list. Use a loop to calculate the total sales for theweek. Display the total sales, the day which had the highest sales,and the day that had the lowest sales.
Sunday,10839.33Monday,8921.47Tuesday,15932.34Wednesday,7319.21Thursday,11093.82Friday,2304.90Saturday,9023.83
(Python)
Solution
#code.pyfileName = “sale.txt”result = 0lst = []try: f = open(fileName) s = 0 for x in f: lst.append(x.strip().split(“,”)) f.close()except FileNotFoundError as f: print(“nFile”,fileName,”could not found.
OR
OR