import argparse
def calculate_insurance_pension(K, SZZP, PK):
return K * SZZP * PK
def calculate_accumulated_pension(total_savings, planned_payout_period):
return total_savings / planned_payout_period
def calculate_social_pension(base, work_experience_bonus, age_bonus):
return base + work_experience_bonus + age_bonus
parser = argparse.ArgumentParser(description='Calculate pension in Russia.')
parser.add_argument('--insurance', nargs=3, type=float, metavar=('K','SZZP','PK'), help='Calculate insurance pension. Need K, SZZP, PK.')
parser.add_argument('--accumulated', nargs=2, type=float, metavar=('SAVINGS','PERIOD'), help='Calculate accumulated pension. Need total savings and payout period.')
parser.add_argument('--social', nargs=3, type=float, metavar=('BASE','WORK_BONUS','AGE_BONUS'), help='Calculate social pension. Need base, work experience bonus, age bonus.')
args = parser.parse_args()
if args.insurance:
K, SZZP, PK = args.insurance
pension = calculate_insurance_pension(K, SZZP, PK)
print(f'Insurance pension: {pension} rubles per year or {pension/12:.2f} rubles per month.')
if args.accumulated:
total_savings, planned_payout_period = args.accumulated
pension = calculate_accumulated_pension(total_savings, planned_payout_period)
print(f'Accumulated pension: {pension:.2f} rubles per month.')
if args.social:
base, work_experience_bonus, age_bonus = args.social
pension = calculate_social_pension(base, work_experience_bonus, age_bonus)
print(f'Social pension: {pension} rubles.')