I am trying to find the area of a triangle given 3 sets of coordinates. How can I convert the coordinates from an array to pairs (a1, b1), (a2, b2), (a3, b3) and calculate the area of the triangle?
def getTriangleArea(x, y):
///What will be the code
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
x_count = int(input().strip())
x = []
for _ in range(x_count):
x_item = int(input().strip())
x.append(x_item)
y_count = int(input().strip())
y = []
for _ in range(y_count):
y_item = int(input().strip())
y.append(y_item)
result = getTriangleArea(x, y)
fptr.write(str(result) + '\n')
fptr.close()