def getEvolutionratemessage (before , after) : | |
try : | |
evolution = (after - before ) / before * 100 | |
except ZeroDivisionError : | |
return "can't divide by zero " | |
if evolution > 0 : | |
statement = f"A Positive evolution of {round(evolution)}%" | |
elif evolution < 0: | |
statement = f"A Negative evolution of {round(evolution)}%" | |
else : | |
statement = f"No evolution" | |
return statement | |
print (getEvolutionratemessage(95.12 , 66.84)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment