"""Calculate resources koef""" def calc_resource_factor(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_resource_factor = calc_resource_factor(resource_limit, koef_value) new_resource_factor = calc_resource_factor(resource_limit + deep_expo, koef_value) percentage = 100 / initial_resource_factor * new_resource_factor - 100 print('{:8.2f} {:8.2f} {:8.2f}'.format( initial_resource_factor, new_resource_factor, percentage )) if __name__ == "__main__": print("old new percentage") # gold calc_resource(418, 219, 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) print("oil zuid") calc_resource(296, 75, 0.65) print("gold maldiven") calc_resource(198, 439, 0.4) print("25 uranium") calc_resource(25, 26, 0.75)