def _dec2base(n, base):
 if ((n < 0) or (base < 2) or (base > 36)):
  return ''
 s = ''
 while True:
  r = (n % base)
  s = (digits[r] + s)
  n = (n // base)
  if (n == 0):
   break
 return s

def _dec2base ( n , base ) : if ( ( n < 0 ) or ( base < 2 ) or ( base > 36 ) ) : return '' s = '' while True : r = ( n % base ) s = ( digits [ r ] + s ) n = ( n // base ) if ( n == 0 ) : break return s
convert positive decimal integer n to equivalent in another base URL .