"""Ex. 6.9 from 'A primer on...' Minor modification of the code from ex 3.16. The function should perform the same calculations, but the argument is a dictionary instead of a list" """ def triangle_area(v): [x1,y1] = v[1] [x2,y2] = v[2] [x3,y3] = v[3] A = abs(0.5*( (x2*y3)-(x3*y2)-(x1*y3)+(x3*y1)+(x1*y2)-(x2*y1) )) return A v1 = (0,0); v2 = (1,0); v3 = (0,2) #vertices = [v1, v2, v3] vertices = {1:v1,2:v2,3:v3} print(triangle_area(vertices)) """ Terminal> python area_triangle_dict.py 1.0 """