education.py 616 B

1234567891011121314151617181920
  1. """Calculate resources koef"""
  2. def calc_koef(education_level):
  3. """Calculate koef based on education"""
  4. max_work_exp = 80000 + 200 * education_level
  5. return pow(max_work_exp / 10, 0.6)
  6. def calc_education_koef(old_education, new_education):
  7. """Calculate resource koef for eductaion"""
  8. old_koef = calc_koef(old_education)
  9. new_koef = calc_koef(new_education)
  10. percentage = 100 / old_koef * new_koef
  11. print("%8.2f%8.2f%8.2f" % (old_koef, new_koef, percentage))
  12. if __name__ == "__main__":
  13. print("old new percentage")
  14. calc_education_koef(30, 286)
  15. calc_education_koef(286, 350)