title: 'You must prompt for the data '-says in python coding problem, but I don't know what's wrong with my code?
body: <p>Write a program to prompt the user for hours and rate per hour using input to compute gross pay.<br> Pay should be the normal rate for hours up to 40 and time-and-a-half for the hourly rate for all hours worked above 40 hours.<br> Put the logic to do the computation of pay in a function called computepay() and use the function to do the computation. The function should return a value.<br> Use <strong>45 hours</strong> and a rate of <strong>10.50 per hour</strong> to test the program (the pay should be <strong>498.75</strong>). You should use input to read a string and float() to convert the string to a number. <br>Do not worry about error checking the user input unless you want to - you can assume the user types numbers properly. Do not name your variable sum or use the sum() function.</p>
  <p>I tried this using my pc IDE and got similar output as required.<br> But I got error that:</p>
  <blockquote>
  <p>You must prompt for the data.</p>
  </blockquote>
  <p><br>What's the problem? I mean,when do we get such errors?</p>
  <pre><code>prompt1 = &quot;Enter Hours:&quot;
  prompt2 = &quot;Enter Rate:&quot;
  def computepay(h,r):
      if h &gt; 40:
          pay = ((h -40)*.5 + h)*10.50
      else:
          pay = h*10.50
      return pay
  
  hrs = int(input(prompt1))
  rate = float(input(prompt2))
  ans = computepay(hrs,rate)
  print(&quot;Pay&quot;,ans)`
  </code></pre>