Relax, the teacher will reject the use of such built-in function.
His friend only has to copy the implementation of said function (for 1 implmentation).
Of course this implementation may still be way above the skills he is expected to have, so
his friends teacher might still reject it.
I still think however that we should
help people who ask for this, but (especially for homework assignments) we should not give away code, but give hints and tips (and possibly minor corrections) on the code they can show us.
It's a matter of principle.
Bart