title: Python: Return function won’t return a list
body: <p>The following function prints installed apps from a server. </p>
  
  <pre><code>def getAppNames():
      for app in service.apps:
          print app.name   
  </code></pre>
  
  <p>It works absolutely fine and it prints a list of installed apps like so:</p>
  
  <p>App A</p>
  
  <p>App B</p>
  
  <p>App C</p>
  
  <p>App D</p>
  
  <p>App E</p>
  
  <p>App F</p>
  
  <p>However when I change the "print" to a "return", all I get is "App A". I have seen similar questions on this but I cant find a solution and have explored different methods. Basicly I require the return function like the print function, I would appreciate any help.
  Thanks.</p>