title: How can I use `return` to get back multiple values from a for loop? Can I put them in a list?
body: <p>I have some code that prints data from a global dictionary named <code>cal</code>:</p>
  <pre><code>def show_todo():
      for key, value in cal.items():
          print(value[0], key)
  </code></pre>
  <p>However, I want to use this code as part of a Discord bot. In order for the bot to work properly, I need to <code>return</code> the data to another function that will actually send the message to the Discord chat. Using <code>print</code> like above means that the message is displayed in my local console window, and the chat just sees <code>None</code>.</p>
  <p>I tried to fix it by using <code>return</code> instead:</p>
  <pre><code>def show_todo():
      for key, value in cal.items():
          return(value[0], key)
  </code></pre>
  <p>but this way, the for loop does not work properly. I only get at most one key-value pair from the dictionary.</p>
  <p>How can I fix this, so that all of the data is returned?</p>