변수명 변경 (1) 썸네일형 리스트형 [리팩토링 2판 파이썬 코드로 변경해보기] 3탄 함수 쪼개기, 변수명 변경 리팩토링 2판의 제일 처음 나오는 예제를 파이썬 코드로 변경 하면서, 책의 내용에 따라 리팩토링 해보고 저자의 의견과 내 의견을 정리 import json import math def statement(invoice, plays): total_amount = 0 volume_credits = 0 result = f"청구 내역 (고객명: {invoice['customer']})\n" dollar_format = '${:,.2f}' for perf in invoice["performances"]: play = plays[perf["playID"]] this_amount = 0 if play["type"] == "tragedy": this_amount = 40000 if perf["audience"] > 30.. 이전 1 다음