Session Ready
Exercise

Weighted probability

Txs Tools, a company selling hardware tools, is looking to expand out of their home market A into Market B. They have done some market research, and have received the following numeric probabilities:

Sales Level (USD) Probability (%)
0 5
200 10
300 40
500 20
800 25

Txs Tools will only be motivated to expand if they can have reasonable assurance that they will achieve sales of 400 or more. To manage the different forecast sales probabilities, Txs Tools have asked you to calculate the weighted probability.

Instructions
100 XP
  • Calculate weighted probability for the sales level of Txs tools based on the probability table by creating a combined sales_probability list with pair values as a string separated by a pipe character |.
  • Create a loop iterating over the list to give the a weighted probability.
    • The for loop should iterate through each pair in the list and split the parts by specifying the character that separates the pairs.
  • Print the result.