Fallstudie: Software in Python entwickeln
Mark Pedigo, PhD
Principal Data Scientist

Hypotheken für Neubauten bestimmen

+, -, *, /, **
Code wird zwischen Klassen wiederverwendet
FinancialCalculator) erbt alle Funktionen von der Elternklasse (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 und Unit-Tests

Fallstudie: Software in Python entwickeln