123456789101112131415161718 |
- """Calculate resources koef"""
- def calc_koef(level):
- """Calculate koef based on level"""
- return pow(level, 0.8)
- def calc_level_koef(old_level, new_level):
- """Calculate resource koef for level"""
- old_koef = calc_koef(old_level)
- new_koef = calc_koef(new_level)
- percentage = 100 / old_koef * new_koef
- print("%8.2f%8.2f%8.2f" % (old_koef, new_koef, percentage))
- if __name__ == "__main__":
- print("old new percentage")
- calc_level_koef(86, 92)
|