Skip to content

Instantly share code, notes, and snippets.

@denoboi
Created February 5, 2021 09:44
Show Gist options
  • Save denoboi/1fac1e828f8a41e112efa9b9b130e13f to your computer and use it in GitHub Desktop.
Save denoboi/1fac1e828f8a41e112efa9b9b130e13f to your computer and use it in GitHub Desktop.
Write a program to prompt the user for hours and rate per hour using input to compute gross pay. 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. Put the logic to do the computation of pay in a function called computepay() and use the function to do the computation. The…
hrs = input("Saati gir pezo: ")
h = float(hrs)
hrt = input("Rate kac:")
r = float(hrt)
def computepay(a, b):
if (a <= 40):
islem = a * b
elif (a > 40):
islem = 40 * b + (a-40)*b*1.5
return islem
t = computepay (h,r)
print("Pay",t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment