Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement