Skip to content

Instantly share code, notes, and snippets.

@devparkk

devparkk/evolution rate.py

Last active Sep 10, 2019
Embed
What would you like to do?
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