title: Can't use returned variable in another file - Python
body: <p>I am trying to use a variable defined in one file (file1.py) in another file (file2.py).
  File 1 contains "shoe" which is a queue, which has been tested and worked fine. So it does not look like the problem is with the implementation of the queue. 
  Context on what the variable of issue is:
  result is merely a shuffled list made out of another list called cardList. result is shuffled within the shuffle function. It is a local variable within the scope of shuff. To get around this, I did try using: <code>global result</code>, and then import it again, but it did not work, so I am probably using <code>global</code> wrong? </p>
  
  <p>Here are what I have tried so far that don't work for me:
  <strong>In File1:</strong> where <code>cardList</code> is a list of 120 items. </p>
  
  <pre><code>def shuff(deck): # this function works fine within file1
      for i in range(0, 9):
      result = []
      popped = cardList.pop(R.randint(0, len(cardList)-1))
      result = result.append(popped)
  
      return result
  
  def main():
      shuff(cardList)
  </code></pre>
  
  <p>In <strong>File2</strong></p>
  
  <pre><code>from File1 import result
  </code></pre>
  
  <p>The above does not work, so I looked around and followed an answer which said my variable needs to be in main(), so I tried the following:, in <strong>File1</strong></p>
  
  <pre><code>def main():
      result = shuff(cardList)
  </code></pre>
  
  <p>I tried method 2 by removing the "return result" because I thought that it may override the existing result variable. But I also tried it without that, and both ways, it did not seem to work. </p>
  
  <p>Lastly,
  I made result a Global Var in File1 under the shuff function. And that did not seem to work either</p>
  
  <p>Am I doing something wrong?</p>