I have written the following code to find the area of triangle in terms of its three sides a, b and c:
s = lambda a, b, c : (a + b + c)/2
area_tri = lambda a, b, c : (s(a,b,c) * (s(a,b,c)-a) * (s(a,b,c)-b) * \
(s(a,b,c)-c)) ** 0.5
area_tri(1, 2, 3)
Output: 7.3484692283495345
I have two questions. First, how to reduce the repeated typing of s(a,b,c) in the lambda function for area_tri? Secondly, conjoined to the first question, how to reduce the number of invocations to lambda s in area_tri?