"""Calculate resources koef""" def calc_koef(resource_limit, koef_value): """Calculate koef based on limit""" return pow(resource_limit * koef_value / 10, 0.8) def calc_resource(resource_limit, deep_expo, koef_value): """Calculate deep expo for resource""" initial_koef = calc_koef(resource_limit, koef_value) new_koef = calc_koef(resource_limit + deep_expo, koef_value) percentage = 100 / initial_koef * new_koef print("%8.2f%8.2f%8.2f" % (initial_koef, new_koef, percentage)) if __name__ == "__main__": print("old new percentage") # gold calc_resource(379, 258, 0.4) # oil calc_resource(223, 148, 0.65) # ore calc_resource(247, 109, 0.65) # uranium calc_resource(2, 23, 0.75) # diamonds calc_resource(2, 25, 0.75) print("lux") calc_resource(267, 89, 0.65)