title: how can i work on this problem related to 2d coordinates of a polyline
body: <p>I have a string input of coordinates of poly-line:</p>
  
  <pre><code> (1,2)(2,3)(4,5)(8,9)
  </code></pre>
  
  <p>I have function :-</p>
  
  <pre><code>def distance(p1,p2):
  </code></pre>
  
  <p>How can I send the value <code>(1,2)</code> and <code>(2,3)</code> to <code>p1</code> and <code>p2</code> and so on and calculate distance between each points?</p>