logo CodeStepByStep logo

pay

Language/Type: Python parameters return

Write a function named pay that accepts two parameters: a real number for a teaching assistant (TA)'s salary, and an integer for the number of hours the TA worked this week. The function should return how much money to pay the TA. For example, the call of pay(5.50, 6) should return 33.0. The TA should receive "overtime" pay of 1.5 times the normal salary for any hours above 8. For example, the call of pay(4.00, 11) should return (4.00 * 8) + (6.00 * 3) or 50.0.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.