I have such lambda:
pit = lambda p, q, r: min(A[p] - A[q], A[r] - A[q])
How I can write it on "plain" python
You mean as a named function? Then you would just use the def and return keywords
def pit(p, q, r):
return min(A[p] - A[q], A[r] - A[q])