In: Computer Science
Write python code which displays the sales commission based on the total sale and the employee’s region, using on the following table.
| 
 Total Sale  | 
 Region  | 
 Commission  | 
| 
 Under $2,500  | 
 East  | 
 5%  | 
| 
 $2,500 or more  | 
 East  | 
 7.5%  | 
| 
 Under $2,500  | 
 West  | 
 10%  | 
| 
 $2,500 or more  | 
 West  | 
 12.5%  | 
(In the sample o/p screenshots the values in black color are the values we input. WHen you input region the first letter of region is capital)
Code Explanation:
Code:
total_sale = int(input("Enter total sales: "))
region =input("Enter region: ")
if(total_sale < 2500 and region == "East"):
sales_commission = 5/100*total_sale
  
if(total_sale >= 2500 and region == "East"):
sales_commission = 7.5/100*total_sale
  
if(total_sale < 2500 and region == "West"):
sales_commission = 10/100*total_sale
if(total_sale >= 2500 and region == "West"):
sales_commission = 12.5/100*total_sale
print("sales commission is: ", sales_commission)
  
Sample O/P1:
Enter total sales: 2600
Enter region: East
sales commission is: 195.0
Sample O/P2:
Enter total sales: 2000
Enter region: East
sales commission is: 100.0
Sample O/P3:
Enter total sales: 2700
Enter region: West
sales commission is: 337.5
Sample O/P4:
Enter total sales: 1900
Enter region: West
sales commission is: 190.0
Code Screenshot:

Sample O/P1 screenshot:
Here total sales is 2600 which is greater than 2500. and region is East. From the given condition
when total sales > 2500 and region is east commission is 7.5%. So 7.5% of 2600 = 195

Sample O/P2 screenshot:
Here total sales is 2000 which is less than 2500. and region is East. From the given condition when
total sales < 2500 and region is east commission is 5%. So 5% of 200 = 100

Sample O/P3 screenshot:
Here total sales is 2700 which is greater than 2500. and region is West. From the given condition
when total sales > 2500 and region is Wast commission is 12.5%. So 12.5% of 2700 = 337.5

Sample O/P4 screenshot:
Here total sales is 1900 which is less than 2500. and region is West. From the given condition
when total sales < 2500 and region is West commission is 10%. So 10% of 1900 = 190

(If you still have any doubts please comment I will definitely help)