케이스 스터디: Python으로 소프트웨어 만들기
Mark Pedigo, PhD
Principal Data Scientist

신규 주택 모기지 산정

+, -, *, /, **
클래스 간 코드 재사용
FinancialCalculator)는 부모 클래스(BasicCalculator)의 모든 기능을 상속합니다class BasicCalculator:
def multiply(self, x, y):
result = x * y
return result
...
# Child of BasicCalculator
class FinancialCalculator(BasicCalculator):
def months_from_years(self, years):
# Inherits the .multiply() method
return self.multiply(years, 12)
...
doctest와 단위 테스트

케이스 스터디: Python으로 소프트웨어 만들기