The novice Python programmer is back.

I'm trying to incorporate a function and its call in the GrossPay.py script
that Alan solved for me.
It computes total pay based on two inputs, no. of hours and hourly rate.

There's a computation for overtime payments in the if statement.

Something seems to be broken.

Here's the code:
def computepay(hours, rate):
    hours = float(raw_input ('How many hours do you work?\n'))
    rate = float(raw_input ('What is your hourly rate?\n'))
    if hours > 40:
        gross = ((hours - 40) * (rate * 1.5)) + (40 * rate)
    elif hours >= 0 and hours <= 40:
        gross = hours * rate
    print "Your Gross pay is "+str(round(gross, 4))

computepay()

What am I doing wrong?

*Warm regards,*

*Olaoluwa O. Thomas,*
*+2347068392705*
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to