Now, let's connect this code to some basic probability "common sense" theory. For the red ball, you can think of choosing a red ball as
$$\frac{\textrm{ways of choosing a red ball}}{\textrm{total ways of choosing a ball}}$$
which here is $6/15=0.4$, which is what your code should display for large enough $N$.
Here's another way of thinking about it: The sample space of balls is 15 total possible. If you have an equally likely chance of choosing any ball, then there's a $1/15$ chance of choosing any ball. Since there are 6 red balls, you then have a $6\times 1/15$ chance of choosing a red ball. Picking a white or blue ball can be calculated using a similar argument. (Chance of blue=5/15=1/3, chance of white=4/15.)
What about the "not red?" Well, this will just be 1-"the chance of picking red." or $1-0.4=0.6$. "1-something" in this business kind of means "not," or "not red." Why? Well 1 means 100% certainty, and if 0.4 of the certainty goes into picking a red ball, then the "rest" or $1-0.4$ would mean picking a ball that was not red.
You can also think of the "not red" in this way:
$$\frac{\textrm{ways of choosing a blue or white ball}}{\textrm{total ways of choosing a ball}}$$
which for "not red" (i.e. a blue or white ball) would be (4+5)/15=9/15=0.6.
Choosing a red or white ball can be computed in your code with
if balls[b] == "r" or balls[b] == "w" then. The answer can be computed via:
$$\frac{\textrm{ways of choosing a red or white ball}}{\textrm{total ways of choosing a ball}}$$
which here would be 10/15=0.3.