There is no error with that code as such, I suspect the "error" is a comment from your tutor
You have hard-coded the answer in your
computepay
function but your tutor wants you to
calculate it from the input i.e.
def computepay(h, r):
return float(h) * float(r)
I put the float() function in because Fiddle moaned at me and I couldn't be bothered to work out why if I'm being honest
You are also hard-coding the values to calculate instead of
prompting for them. This line needs to change
p = computepay(45, 10.5)
You also need an additional
input()
call for the Rate.
I will leave these last two points to you as this is your homework