def getLoopLength(polygon):
 polygonLength = 0.0
 for pointIndex in xrange(len(polygon)):
  point = polygon[pointIndex]
  secondPoint = polygon[((pointIndex + 1) % len(polygon))]
  polygonLength += abs((point - secondPoint))
 return polygonLength

def getLoopLength ( polygon ) : polygonLength = 0.0 for pointIndex in xrange ( len ( polygon ) ) : point = polygon [ pointIndex ] secondPoint = polygon [ ( ( pointIndex + 1 ) % len ( polygon ) ) ] polygonLength += abs ( ( point - secondPoint ) ) return polygonLength
get the length of a polygon perimeter .