# This program calculates sales commissions. # Create a variable to control the loop. keep_going = 'y' # Calculate a series of commissions. while keep_going == 'y': # Get a salesperson's sales and commission rate. sales = float(input('Enter the amount of sales: ')) comm_rate = float(input('Enter the commission rate: ')) # Calculate the commission. commission = sales * comm_rate # Display the commission. print 'The commission is $%.2f' % commission # See if the user wants to do another one. keep_going = raw_input('Do you want to calculate another ' + \ 'commission (Enter y for yes): ')