id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

paySalary


Write a function named paySalary that accepts a number for a salary and an integer for the number of hours were worked this week, and returns how much money to pay. For example, the call paySalary(5.50, 6) should return 33.0. There is "overtime" pay of 1 ½ normal salary for any hours above 8. For example, the call paySalary(4.00, 11) should return (4.00 * 8) + (6.00 * 3) or 50.0.


paySalary(5.5, 6) → 33.0
paySalary(4.0, 11) → 50.0
paySalary(10, 3) → 30

...Save, Compile, Run (ctrl-enter)

def paySalary(salary, hours):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 200

Copyright Nick Parlante 2017 - privacy