code: def bezier_curve_approx_len(P=[(0.0, 0.0)]):
      '''Return approximate length of a bezier curve defined by control points P.
  Segment curve into N lines where N is the order of the curve, and accumulate
    the length of the segments.
      '''
      assert isinstance(P, list)
      assert len(P) > 0
      for p in P:
          assert isinstance(p, tuple)
          for i in p:
              assert len(p) > 1
              assert isinstance(i, float)
      
      n_seg = len(P) - 1
      pts = pts_on_bezier_curve(P, n_seg)
      return sum([distance_between_pts(pts[i], pts[i+1]) for i in range(n_seg)]f bezier_curve_approx_len(P=[(0.0, 0.0)]):
      '''Return approximate length of a bezier curve defined by control points P.
  Segment curve into N lines where N is the order of the curve, and accumulate
    the length of the segments.
      '''
      assert isinstance(P, list)
      assert len(P) > 0
      for p in P:
          assert isinstance(p, tuple)
          for i in p:
              assert len(p) > 1
              assert isinstance(i, float)
      
      n_seg = len(P) - 1
      pts = pts_on_bezier_curve(P, n_seg)
      return sum([distance_between_pts(pts[i], pts[i+1]) for i in range(n_seg)])
docs: Return approximate length of a bezier curve defined by control points P.
  Segment curve into N lines where N is the order of the curve, and accumulate
    the length of the segments.