title: How to avoid last comma in python loop
body: <p>I want to print the result output in the form of separated by a comma but i am getting a comma in last value also so how can i remove that.</p>
  
  <pre><code>import math
  
      d = input().split(',')
      d = [int(i) for i in d]
      c=50
      h=30
      result=[]
      for i in d:
          q=int(round(math.sqrt((2*c*i)/h)))
          result.append(q)
      for i in result:
          print(i, end=",")
  </code></pre>
  
  <p>here is an example of input i give and output i get</p>
  
  <pre><code>input : 10,20,30,40
  output : 6,8,10,12,
  </code></pre>
  
  <p>how can i avoid getting that last comma </p>