Week 1 Assignment 1 exercise 6

I’ve been struggling with this for a long time. I get the same error always. What should I do? Also match keyword doesn’t seem green and bold is it related to me?

This propability_f variable needs to be initialized outside before entering the loop, otherwise when the loop finishes it will delete it.

And thats why you are getting this error after the loop, this variable cannot be found anymore.

The most common issue that causes this error with probability_f is if the value that is being checked is not one of the match cases.
Could be a problem in setting the match values, or in the values you’re passing to the function.