로그인 바로가기 하위 메뉴 바로가기 본문 바로가기

모두를 위한 프로그래밍 : 파이썬

임시 이미지 커넥트재단 edwith
http://www.edwith.org/pythonforeverybody/forum/128319
좋아요 2776 수강생 48859
try:
    en_hour = float(input("Enter your hours: "))
    en_rate = float(input("Enter your rate: "))
except:
        print("Please enter a number")
        quit()


def computepay(hour, rate):
        if hour > 40 :
            reg = hour * rate
            ovt = (hour - 40) * (rate * 0.5)
            total = reg + ovt
        else:
            total = hour * rate
            
        return total
    

print(computepay(en_hour, en_rate))