def add_commas(n):
 strn = str(n)
 lenn = len(strn)
 i = 0
 result = ''
 while (i < lenn):
  if ((((lenn - i) % 3) == 0) and (i != 0)):
   result += ','
  result += strn[i]
  i += 1
 return result

def add_commas ( n ) : strn = str ( n ) lenn = len ( strn ) i = 0 result = '' while ( i < lenn ) : if ( ( ( ( lenn - i ) % 3 ) == 0 ) and ( i != 0 ) ) : result += ',' result += strn [ i ] i += 1 return result
receives integer n .