Step-by-step explanation:
the other answer is correct.
I will just try to give you a little bit more explanation about the why.
when you have a function definition or simply an expression using variables, these variables are nothing else but placeholders for actual values.
such expressions are like a recipe : a structure of instructions what to do, when you get the real ingredients.
so, when or function is like here
f(p) = 3p²
it simply means that as soon as we get a real value for p, we have to square this value and then multiply that result by 3. and that is then the functional result.
and indeed, we have a specific value for p : p = 7.
so, now, we take this "7" and put it in every place, where there is a "p" in the "recipe" (because it could be a much more complex function with multiple terms based on "p").
just like we would use e.g. real butter and put it into our dough in the way the recipe describes how and when to apply butter in general.
hence,
3×7² = 3×49 = 147