title: Python, formula to get the monthly percentage income performance
body: <p>I have the following code:</p>
  <pre><code>import datetime
  
  total_income = {'Revenues': [100 for m in range(12)]}
  
  current_month = datetime.date.today().month
  
  current_revenue = total_income['Revenues'][current_month - 1]
  cumulative_revenue = sum(total_income['Revenues'][:current_month])
  </code></pre>
  <p>All works perfectly but now I wanna get the percentage increase/decrease monthly value compared to the previous month. Ad example if <code>current_month = 6</code> I want to calculate the percentage increase/decrease compared to the may month.</p>
  <p>Ad example:</p>
  <pre><code>current_montlhy_performance = (revenuse_jun-revenuse_may)/revenuse_may*100
  </code></pre>
  <p>Moreover I wanna manage all error that could arise ad example if the denominator is <strong>equal to zero</strong>.</p>