4. [단일책임원칙] 단일 책임 원칙 적용 III
지금 아래 코드는 단일 책임 원칙 을 적용하기 전 Ship 클래스이다. class Ship: """배 클래스""" def __init__(self, fuel, fuel_per_hour, supplies, num_crew): """연료량, 시간당 연료 소비량, 물자량, 선원 수를 인스턴스 변수로 갖는다""" self.fuel = fuel self.fuel_per_hour = fuel_per_hour self.supplies = supplies self.num_crew = num_crew def report_fuel(self): """연료량 보고 메소드"""
NULL
2021-10-16
0 0