-1
hours = input("Enter hours: ")
rate = input("Enter rate: ")
try:
hours = float(hours)
rate = float(rate)
except:
print("Enter real numbers")
def computepay(hours, rate):
if hours <= 40.0:
pay = hours * rate
return pay
elif hours > 40:
pay = 40 * rate
exhrs = (hours - 40) * (1.5 * rate)
totpay = pay + exhrs
return totpay
print("Pay: %s" % computepay(hours, rate))
実行を継続しているということですか? –