title: How do i use lists from other functions?
body: <p>Still learning python3 and im currently creating a domino game. I'm making progress so far but i haven't been working with functions at all.</p>
  <p><strong>My question is:</strong> How do i get the domino_stock_set into my split_stones function so i can split it up?</p>
  <p>Seems like a dumb question but i googled half an hour and couldn't find anything that would work. I tried anything so at this point i might have several erros in the script.</p>
  <pre><code>import random
  
  random_hand = random.randint(0, 7)
  random_sixseven = random.randint(6,7)
  
  
  
  def stock_set():
      global domino_stock_set
      domino_stock_set = []
      for i in range(0, 7):
          for j in range(i, 7):
              domino_stock_set.append([i, j])
      random.shuffle(domino_stock_set)
      
      print()
      print(&quot;…ᘛ⁐̤ᕐᐷ  -Stock Set-  …ᘛ⁐̤ᕐᐷ&quot;)
      print(domino_stock_set)
      print()
      return domino_stock_set
  
  
  
  def split_stones(domino_stock_set, wanted_parts=1):
      length = len(domino_stock_set)
      return [ domino_stock_set[i*length // wanted_parts: (i+1)*length // wanted_parts] 
               for i in range(wanted_parts) ]
  
  print(&quot;==============P L A Y E R==================&quot;)
  print(split_stones(domino_stock_set, wanted_parts = random_sixseven))
  
  print(&quot;=============C O M P U T E R===============&quot;)
  print(split_stones(domino_stock_set, wanted_parts = random_sixseven))
  
  
  
  stock_set()
  split_stones()
  </code></pre>