title: Calling a function in a loop of another function
body: <p><strong>Background</strong> - I have a function that takes an API response (<code>api_response</code>) from another function (<code>api_response = api_call()</code>). <code>Code Block #1</code> continues to iterate until <code>meta</code> is in the response. Once <code>meta</code> is in <code>api_response</code> then <code>Code Block #2</code> will return <code>api_response</code>.</p>
  <p><strong>Issue</strong> - whilst my code is testing <code>api_response</code> for <code>meta</code>, I haven't found a way to include continuously calling the other function (<code>api_response = api_call()</code> in my <code>while loop</code>, which will allow determination as to when <code>meta</code> is still in <code>api_response</code>.</p>
  <p><strong>Function</strong> -</p>
  <pre><code>def unpack_response():
      # Code Block # 1
      api_response = api_call()
      while &quot;meta&quot; not in api_response:
          id_value = &quot;id&quot;
          res1 = [val[id_value] for key, val in api_response.items() if id_value in val]
          id_value = &quot;&quot;.join(res1)
          percent_value = &quot;percent_complete&quot;
          res2 = (tuple(api_response[&quot;data&quot;][&quot;attributes&quot;].get(&quot;percent_complete&quot;, '') for key, val in api_response.items()))
          print(f' Your data requested, associated with ID: {id_value} is {res2} complete!')
      # Code Block # 2
      if &quot;meta&quot; in api_response:
          return api_response
  unpack_response()
  </code></pre>
  <p><strong>Question</strong> - does anyone have any pointers, as to how I might integrate <code>api_response</code> into my loop, so it keeps being called every loop iteration?</p>