-
-
Save KKarthikeya/0696fe56a97c0699c3c5 to your computer and use it in GitHub Desktop.
def computepay(hours,rate): | |
if hours>40.0: | |
p = rate * 40.0 | |
p = p+(1.5*rate*(hours-40)) | |
else: | |
p = rate*hours | |
return p | |
hours = float(raw_input("Enter worked hours: ")) | |
rate = float(raw_input("Enter Pay rate per hour: ")) | |
print computepay(hours,rate) |
Well done
def computepay(hours,rate):
if hours>40.0:
p = rate * 40.0
p = p+(1.5rate(hours-40))
else:
p = rate*hours
return p
hours = float(raw_input("Enter worked hours: "))
rate = float(raw_input("Enter Pay rate per hour: "))
p=(computepay(hours,rate))
print("Pay",p)
This code is definitely gonna run on any platform.
Just try it once.
def computepay(h,r):
if h>40.0:
p=1.5 * float(r) * (h-40.0)+(40.0 * float(r))
else:
p=h*r
return p
hrs = input("enter hours:")
a=float (hrs)
rate = input("enter rate per hour:")
b=float(rate)
p=computepay(a,rate)
print("Pay",p)
help me my code is not running
solution without def
hrs = input("Enter Hours:")
h = float(hrs)
rate = input("Enter Pay Rate:")
r = float(rate)
pay = hr
otpay = 40r + (h-40)r1.5
if h<=40:
print(pay)
else:
print(otpay)
def computepay(h,r):
if h>40.0:
p = r * 40.0
p = p+(1.5r(h-40))
else:
p = r*h
return p
h = float(input("Enter Hours:"))
r = float(input("Enter rate:"))
p = computepay(h,r)
print("Pay",p)
Okay then I hope they accepted your code right?