-
[Python] 2-2 <실습> 함수 만들기05. Programing Language/[Python] 2.모두를 위한 프로그래밍 파이썬 2020. 1. 5. 14:27
where am i? 즐거운 실습 시간 이네요
def computepay(hours, rate): #print("in computepay", hours, rate) if hours > 40 : reg = rate * hours otp = (hours - 40.0) * (rate * 0.5) pay = reg + otp else: pay = hours * rate #print("Returning", pay) return pay sh = input("Enter Hours: ") sr = input("Enter Rate: ") fh = float(sh) fr = float(sr) xp = computepay(fh, fr) print("Pay : ", xp)
'05. Programing Language > [Python] 2.모두를 위한 프로그래밍 파이썬' 카테고리의 다른 글
[Python] 2-4 for 루프 (0) 2020.01.06 [Python] 2-3 while 루프 (0) 2020.01.06 [Python] 2-1 함수 만들기 (0) 2020.01.05 [Python] 1-9<실습> 예외처리(try, except)를 이용한 에러 해결 (0) 2020.01.03 [Python] 1-8 <실습> 조건문(if, else) 활용 (2) 2020.01.02