Question: This code executes, however, an error message " NameError: name 'p' is not defined in lines 7 and 11 - I tried adding float( ) around everything - same error - any ideas ????

```
def computepay(hrs,rate):

    if 0 < hrs <=40:
        print (hrs * rate)
    elif hrs > 40:
        print (40 * rate + (hrs-40)*rate*1.5)
    return p   <********  editor claims not defined here

    hrs = float(input("Enter Hours:"))
rate = float(input("Enter Rate per Hour:"))
p = computepay(hrs,rate)  <********  editor claims not defined here
print ("Pay", p)

```

Answer: 
You try to return `p` in a function where p is not declared. I think you want to do this:

```
def computepay(hrs,rate):
    if 0 < hrs <=40:
        p = (hrs * rate)
    elif hrs > 40:
        p = (40 * rate + (hrs-40)*rate*1.5)
    print p
    return p 

```

PS. The line `hrs = float(input("Enter Hours:"))` has a wrong indentation. Remove all white spaces before it.
Well, it is not defined in the function, is it?

There's no statement telling that:

```
p = ...

```

Perhaps you mean to assign p to "(40 \* rate + (hrs-40)\*rate\*1.5)" if hrs > 40, and not only print it?