In "Think Python: How to Think Like a Computer Scientist", the author defines postcondition as:
A requirement that should be satisfied by the function before it ends.
He also states:
Conversely, conditions at the end of the function are postconditions. Postconditions include the intended effect of the function (like drawing line segments) and any side effects (like moving the Turtle or making other changes).
So assume that we have a function called factorial that has a required parameter called n, isn't the expected postcondition of it that it must (i.e it is required to) return a positive integer that represents the product of numbers from 1 through n? Isn't this requirement satisfied after factorial ends?
Is this definition right?
Would defining postcondition as "A requirement that should be satisfied by the function after it ends." be right?
Note: I'm a beginner in programming, in general, and Python, in particular.