The word "for" in English is a preposition, which usually precedes a noun (or sometimes a noun phrase functioning as a noun), e.g., "for Jesús", "in school", "around the tree", "into a dark, gloomy forest". [As a helpful aside, I was taught a preposition is generally any word you can use to fill in the '___' in the sentence, "The airplane flew ___ the cloud."]
Specifically, this particular preposition, "for", can be used in the context of "service", in the sense that person P Performs a Procedure "for" another person B, the Beneficiary, as in: "P made lunch 'for' B", meaning "P made lunch 'for the benefit of' B", or "P made lunch 'on behalf of' B".
So in the context of programming language's quasi-English origin, to give a more verbose example for Mason Wheeler's excellent explanation, consider:
A wealthy householder needs to tell the nanny to make sure that, as each of his seven children line up to walk out the door into the cold to school, she is to perform the appropriate nanny service 'for' each of them, to (a) retrieve the appropriate overcoat 'for' each one, and (b) hand each the brown-bag lunch she had made 'for' each one of them.
In pseudocode, to expand on Mason Wheeler's Pascal example, the father (programmer/code) instructs the nanny (function) thus [with commentary delimited by square brackets]:
[set, array, or range] ChildrenOfMine of [datatype] IndividualChild;
IndividualChild i in ChildrenOfMine;
for [each] i := [starting from] Youngest to [ending at] Eldest do [this service] fnNannyGrabCoat&LunchFor(i);
I hope this helps. I myself find that looking at the etymology/history/usage of a word helps nail down its meanings in its various applications.
for each. So it would becomefor each i, till i is less than 10, perform the following steps.for each ipretty much explains everything.