On May 1, 2016 8:04 AM, "Olaoluwa Thomas" <thomasolaol...@gmail.com> wrote:
>
> The novice Python programmer is back.
Welcome back. We are here to help you when you are stuck. Telling us
something is broken is not adequate. Tell us-what you are expecting the
program to do and what results you're getting.
>
> 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
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to