title: Encompass the output of a for loop into a variable in python
body: <p>I'm trying to define the following for loop as a variable so that it can be sent as a text message using Twilio.  The for loop is parsing some json output.</p>
  
  <pre><code>for item in parsed:
      print item['resource']['caseNumber'], \
      item['resource']['subject'], \
      item['resource']['status'], \
      item['resource']['severity'] 
  </code></pre>
  
  <p>The following code snippet produces output like: </p>
  
  <pre><code>123458 Subject Example Status Example 4 (Low) 
  123138 Subject Example2 Status Example 3 (Normal) 
  145541 Subject Example3 Status Example 2 (High)
  </code></pre>
  
  <p>I'm trying to encompass that entire output into a variable, is that possible?  If not, what's the best way to take the output I've captured from the for loop above and then send it via Twilio with: </p>
  
  <pre><code># Send text messages 
  client = TwilioRestClient(account_sid, auth_token)
  message = client.messages.create(to=to,from_=from_,body=body)
  </code></pre>