Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. def getEvolutionratemessage (before , after) :
  2. try :
  3. evolution = (after - before ) / before * 100
  4. except ZeroDivisionError :
  5. return "can't divide by zero "
  6.  
  7. if evolution > 0 :
  8. statement = f"A Positive evolution of {round(evolution)}%"
  9. elif evolution < 0:
  10. statement = f"A Negative evolution of {round(evolution)}%"
  11. else :
  12. statement = f"No evolution"
  13. return statement
  14.  
  15. print (getEvolutionratemessage(95.12 , 66.84))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement