def water_average_price(old_price, old_quantity, new_price, new_quantity): # 평균 매입가 계산 total_price = (old_price * old_quantity) + (new_price * new_quantity) total_quantity = old_quantity + new_quantity average_price = total_price / total_quantity return average_price# 예시 입력old_price = 50000 # 기존 매입 가격old_quantity = 10 # 기존 주식 수new_price = 45000 # 추가 매수 가격new_quantity = 5 # 추가 ..