Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires In

  Enroll Now

Python - Create Payment Calculator Function

Create a function to calculate the payment to be made based on the hours and rate provided.

INSTRUCTIONS
  • Create a function pay_calculator which will calculate the payment to be made to an employee
  • The function will take 2 arguments; hours, and rate, in that order
  • If the hours are less than or equal to 40, then the payment will be a product of the hours and rate
  • If the hours are greater than 40, then till the 40th hour the payment will be calculate as a product of the hours and rate variables. Beyond the 40th hour, the rate will be 1.5 times that of the original rate variable
  • The function will finally computer the total pay, save it in a variable named total_pay and will return the same
  • Finally, test the function with the following values: hours = 45, and rate = 10
  • The output for the above values should be 475.0

No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...