title: Identical list shuffling doesn't work as function // Python
body: <p>I am currently trying to write a simple shuffle function that shuffles two lists identically. I have got it working outside of a function but as soon as I add it in, it just prints the list normally. Can someone tell me what I am doing wrong or point me in the right direction? Im sure it's something simple.</p>
  
  <p>The first snippet of code is what I am trying to do, and the second is what currently works.</p>
  
  <p>Thanks to anyone who can help.</p>
  
  <p>Cheers</p>
  
  <pre><code>import random
  ARRAYQ = ["Q1", "Q2", "Q3", "Q4"]
  ARRAYA = ["A1", "A2", "A3", "A4"]
  
  def shuffle(list1, list2):
      enclosed = list(zip(list1, list2))
      random.shuffle(enclosed)
      list1, list2 = zip(*enclosed)
      return list1, list2
  
  shuffle(ARRAYQ, ARRAYA)
  print(ARRAYQ)
  print(ARRAYA)
  </code></pre>
  
  <p>.</p>
  
  <pre><code>import random
  ARRAYQ = ["Q1", "Q2", "Q3", "Q4"]
  ARRAYA = ["A1", "A2", "A3", "A4"]
  
  enclosed = list(zip(ARRAYQ, ARRAYA))
  random.shuffle(enclosed)
  ARRAYQ, ARRAYA = zip(*enclosed)
  
  print(ARRAYQ)
  print(ARRAYA)
  </code></pre>