Session Ready
Exercise

Market sentiment

Txs Tools has forecast sales of 500 in January, with an expected increase of 5% per month for the rest of the quarter.

However, this is dependent on the market sentiment. Based on historical trends, the following information has been provided:

  • If the market sentiment drops below 0.6 then the sales will only be realized at an increase of 2% per month.
  • If market sentiment increases above 0.8. then sales are expected to increase by 7%.
Instructions 1/2
undefined XP
  • 1
  • 2
  • Define a computevariance() function with the arguments amount, sentiment.
  • Create an if statement to define the steps when sentiment drops below 0.6, elif if it is above 0.8, and else for when neither condition is met.