def digitsrep(n, b=10):
 if (n <= 0):
  return [0]
 dlist = []
 while (n > 0):
  dlist = ([(n % b)] + dlist)
  n = (n // b)
 return dlist

def digitsrep ( n , b = 10 ) : if ( n <= 0 ) : return [ 0 ] dlist = [ ] while ( n > 0 ) : dlist = ( [ ( n % b ) ] + dlist ) n = ( n // b ) return dlist
return list of digits comprising n represented in base b .