Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculateTotalSalary(month_sal, no_of_years):
- MONTHS_IN_A_YEAR = 12
- BONUS = 1.05
- if no_of_years > 5:
- total_salary = month_sal * 5 * MONTHS_IN_A_YEAR
- extra_years = no_of_years - 5
- total_salary += month_sal * extra_years * MONTHS_IN_A_YEAR * BONUS
- else:
- total_salary = month_sal * no_of_years * MONTHS_IN_A_YEAR
- return total_salary
- if __name__ == "__main__":
- print(calculateTotalSalary(20, 6))
RAW Paste Data