title: What is the run-time complexity of the following algorithm, in terms of a and b?
body: <p>I was wondering what the time complexity of this function would be in terms of two variables. My guess would be O(a*b), due to the while loop using a and b.</p>
  
  <pre><code>def somefunc(a, b):
  
      def anotherfunc(current, num_digits):
  
          if num_digits == 0:
  
              print(current)
  
          else:
  
              print_01_codes('0' + current, num_digits - 1)
  
              print_01_codes('1' + current, num_digits - 1)
  
      upper_bound = 0
  
      while True:
  
          for i in range(upper_bound):
  
              print_01_codes('', a)
  
          if upper_bound &gt; b:
  
              break
  
          upper_bound += 1
  </code></pre>