title: inserting period after every 3 chars in a string
body: <p>I have this:</p>
  
  <pre><code>from __future__ import print_function
  
  def f_comma(p_string):
     v_string = p_string
     if (type(v_string) == type(int()) or type(v_string) == type(long()) or  
         type(v_string) == type(float())):
        v_string = str(v_string)
     else:   
        l_string = list(v_string)
        for v_index in range(3, len(l_string), 4):
           l_string.insert(v_index, ',')
        v_result = ''.join(l_string)
     return (v_result)
  
  print (f_comma('qwertyuiopaq'))
  </code></pre>
  
  <p>It seems that i can't figure it out why if i use a string longer than 11 chars the period stops inserting, but with only 11 chars it works fine. What i'm doing wrong in this piece?</p>