code: def digitsrep(n, b=10):
      """Return list of digits comprising n represented in base b.
      n must be a nonnegative integer"""
  
      if n <= 0:
          return [0]
  
      dlist = []
      while n > 0:
          # Prepend next least-significant digit
          dlist = [n % b] + dlist
          # Floor-division
          n = n // b
      return dlist
  
file_path: networkx/examples/algorithms/plot_iterated_dynamical_systems.py
imports: import networkx
label_desc: Use image node_id 1 for calling a global function with example usage: digitsrep(n, b) and returns: dlist, list