There’s nothing wrong with the syntax you’re using to define p_default — the problem lies in the reasoning. Have you inspected the value you set p_default to? You’ll notice it doesn’t fall between 0 and 1 (in fact, it’s a very large number!) so that’s the first clue that there’s something awry with the calculation method you tried. This is also the source of the error in sample, since you fed it 1 – p_default, which is a (very) negative number.
What made you decide to multiply the number of loans by the money you lose when a loan goes bad to get the probability of a loan going bad? Were you guessing, or did you have a theory about why that might make sense? It won’t be very useful in the long run to find out how to get this problem “right” mechanically without understanding the reasoning behind it. Sorting that out is a great discussion to have here!
My best hint: think about what “a probability” means and how it’s usually expressed mathematically, then revisit the information you were given at the start of the problem,