PYTHON HELP! From Chapter 7 Design and write a program that asks the user to ent
ID: 3605054 • Letter: P
Question
PYTHON HELP!
From Chapter 7 Design and write a program that asks the user to enter a store's sales for each day of the week (i.e., 7 days total) using the names of the days. The sales amounts and names of the days of the week should be stored in lists. Use loops for input and to calculate the total sales for the week. Display the results to the screen with the proper formatting. Example input and output is shown below. Enter the sales for Sunday: 500 Enter the sales for Monday: 200 Enter the sales for Tuesday: 300 Enter the sales for Wednesday: 200 Enter the sales for Thursday: 350 Enter the sales for Friday: 400 Enter the sales for Saturday: 700 Total sales for the week: $2,650.00Explanation / Answer
Sun = int(input(' Enter the sales for Sunday:'))
Mon = int(input(' Enter the sales for Monday:'))
Tue = int(input(' Enter the sales for Tuesday:'))
Wed = int(input(' Enter the sales for Wednesday:'))
Thu = int(input(' Enter the sales for Thursday:'))
Fri = int(input(' Enter the sales for Friday:'))
Sat = int(input(' Enter the sales for Saturday:'))
weeklysale = [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
Tot = 0;
for totalsales in weeklysale:
Tot = Tot + totalsales
print ' Total Sales for the week: $%.2f' % Tot
OUTPUT
Enter the sales for Sunday: 500
Enter the sales for Monday:200
Enter the sales for Tuesday:300
Enter the sales for Wednesday:200
Enter the sales for Thursday:350
Enter the sales for Friday:400
Enter the sales for Saturday:700
Total Sales for the week: $2650.00
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.