Question: Python using idle... I have this program... when I entered 25000 for sales and 100 for advence. I get a local variable error. Whats wrong

Python using idle... I have this program... when I entered 25000 for sales and 100 for advence. I get a local variable error. Whats wrong with this code?

def get_sales()->float: sales=float(input("Enter the monthly sales:")) return sales

def get_advanced_pay()->float: print("Enter the amount of advanced pay, or enter 0 if no advanced pay was given.") advanced_pay=float(input("Advanced pay:")) return advanced_pay

def determine_comm_rate(sales)->float: if sales<10000.00: rate=0.1 elif sales<14999.99: rate=0.12 elif sales<17999.99: rate=0.14 elif sales<21999.99: rate=0.18 return rate

def main(): # Get the amount of sales from user sales = get_sales() # Get the amount of advanced pay from user. advanced_pay = get_advanced_pay() # Determine the commission rate. comm_rate = determine_comm_rate(sales) # Calculate the pay. pay = sales * comm_rate - advanced_pay # Display the amount of pay. print('The pay is $', format(pay, ',.2f'), sep='') # Determine whether the pay is negative. if pay < 0: print('The salesperson must reimburse the company.')

if __name__=="__main__": main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!