Using Python, write a script that accepts a series of sales transactions from the user. For each of the sales transactions, the user will enter 2 values: department and sales total. The application should provide the sum of all sales totals for each entered department and output the totals. The application should also end and display the total when the user enters “none” for the department. You will need to use both branching and loops in this application. You may assume that there are only 2 department names entered. The interaction might look like the following: Enter department: Sporting goods Enter total: 500 Enter department: Grocery Enter total: 1,000 Enter department: None The total for sporting goods is 500. The total for grocery is 1,000. You need to test the application with a total transaction count of eight and two departments.
Using Python, write a script that accepts a series of sales transactions from the user. For each of the sales transactions, the user will enter 2 values: department and sales total.
The application should provide the sum of all sales totals for each entered department and output the totals. The application should also end and display the total when the user enters “none” for the department.
You will need to use both branching and loops in this application. You may assume that there are only 2 department names entered. The interaction might look like the following:
Enter department: Sporting goods
Enter total: 500
Enter department: Grocery
Enter total: 1,000
Enter department: None
The total for sporting goods is 500.
The total for grocery is 1,000.
You need to test the application with a total transaction count of eight and two departments.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images