Drag the slider slowly and watch the number in the code change at the same time. That number is called a variable. You are editing a program without typing any code, which is a fair description of what a lot of programming actually is.
Now look at the line with the stars on it. Notice that the number of characters goes 1, 3, 5, 7, never an even number. That is what makes the sides slope evenly. Change the size and the pattern holds, because the rule is written down rather than drawn by hand.
Change the character. Only one place in the code changes. That is why programmers put things in variables at the top: so there is one place to change, not fifty.