2015-07-01 23:41:28

Hello,

Someone posted last year about this same problem and the responses were great, however I am having a different outcome and can't figure out why I keep getting the computepay() needs 2 arguments and only has 1.  Can someone assist me with what is wrong with my code? The code runs then on line 20 I get the error. I am using Python 3. Thanks in advance for any assistance!!

def computepay(h, r):
    # print ("In computepay h="), h, "r=", r
    if h <= 40:
        p = r * h
    else :
        p = r * 40 + (r * 1.5 * (h - 40))
    # print ("Finished with computepay"), p
    return p
   
try:
    hrs = raw_input("Enter Hours:")
    h = float(hrs)
    rate = raw_input("Enter Rate:")
    r = float(rate)
except:
    print ("Error, please enter numeric input")
    quit()
   
# print ("In the main code"), rate, hours
pay = computepay("hours, rate")
print pay

2015-07-02 02:17:55

pay = computepay(hrs, rate)

This is not a signature.

2015-07-02 04:20:52

Awesome! Thanks so much!!!! Really appreciate it, I was just missing the mark!