def main ():
    display_message ()
    # get user's first name
    first_name = raw_input('Please enter your first name: ')
    print 'Hello', first_name

    # input total sales
    total_sales = raw_input('Please enter your total sales: ')

    # input total hours
    total_hours = raw_input('Please enter your total hours worked: ')

    # input total hours
    total_hours = raw_input('Please enter your total hours worked: ')

def calc ():
    # commission amount
    commission = total_sales * .05

    # hours paid
    hours_paid = hourly_pay * total_hours
    # total gross pay
    total_gross_pay = hours_paid + commission
    # withheld pay

    def display_results (hours_paid,commission,gross_pay,witheld):

    # display hourly rate
    print '%.2f' % hours_paid

    # displays commission
    print commission

    # displays total gross pay
    print total_gross_pay

It needs to calculate the gross pay, pay hours,with held pay (tax), total pay --before tax--

hourly_rate = 7.50
commission_rate = 0.05
withheld_pay = 0.25

it needs to display the results, i need it for work ASAP
Thanks a million

BTW....This is as far as i got. and I am a noob and cant believe how much I did, though its probably wrong. Thanks

8 Years
Discussion Span
Last Post by vegaseat

raw_input gives gives a string, so for numbers you can do calculations with, you will have change the numeric string to a float:
total_sales = float(raw_input('Please enter your total sales: '))


There is an indentation problem with one of the def statements.

You are asking for total_hours twice and should ask for hourly_pay at least once.

You need to pass the required arguments from and to the functions.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.