title: How to remove ending commas in a list of ints with python?
body: <p>I have a function I wrote in python that simple makes a horizontal list of int.  I modified the print statement so that the list would print with commas, but the function adds one after the last int.</p>
  
  <p>Any ideas as how to get rid of it?</p>
  
  <pre><code>num = list(range(20))
  
  def count(x):
      for i in range(len(x)):
          # i+1 add in order to remove beginning zero.
          print(i+1,end=',')
  
  count(num)
  </code></pre>
  
  <blockquote>
    <p>1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,</p>
  </blockquote>