title: Randomly select X number of lists from a list of lists
body: <p>I have something like the following:</p>
  
  <pre><code>pen = [1, 2, 3, 4]
  pencil = [2,3,4,5]
  paper = [3,4,5,6]
  group_of_items = [pen, pencil, paper]
  </code></pre>
  
  <p>I want to randomly select a certain number of lists from this list of lists so that the result is something like this:</p>
  
  <pre><code>[pencil, pen]
  </code></pre>
  
  <p>I found the following from another question (altered to match my situation).</p>
  
  <pre><code>import random
  
  pen = [1, 2, 3, 4]
  pencil = [2,3,4,5]
  paper = [3,4,5,6]
  
  group_of_items = [pen, pencil, paper]
  
  num_to_select = 2
  list_of_random_items = random.sample(group_of_items, num_to_select)
  print(list_of_random_items)
  </code></pre>
  
  <p>It gives something like this.</p>
  
  <pre><code>[[2, 3, 4, 5], [1, 2, 3, 4]]
  </code></pre>
  
  <p>So, it's close but no cigar. I also found this.</p>
  
  <pre><code>import numpy as np
  
  pen = [1, 2, 3, 4]
  pencil = [2,3,4,5]
  paper = [3,4,5,6]
  group_of_items = [pen, pencil, paper]
  num_to_select = 2
  
  random_list = np.random.choice(group_of_items, num_to_select, replace=False)
  
  print(random_list)
  </code></pre>
  
  <p>But it doesn't work with a list of lists (multi-dimensional).</p>
  
  <p><strong>How can I accomplish my goal?</strong></p>
  
  <p><em>Oh, and I don't want any repeats.</em></p>
  
  <p>Note: my coding experience is rather limited. I mostly copy and paste what I find online, only making small changes.</p>
  
  <p><strong><em>Edit</em></strong>: The above is simply a quickly thrown together test. What I've built is a Twitter tweet bot using PythonAnywhere. It works wonderfully as is, but I want to add a more random functionality to it.</p>
  
  <p>I have lists of tweets in a Google spreadsheet that I pull over to a Python list, like so:</p>
  
  <pre><code>quotes = tweet_sheet.col_values(3)
  </code></pre>
  
  <p>I have several lists like this that I put together in one master list of lists. But I don't want to tweet from every list every time I run the program.</p>
  
  <p>Right now I use something like this.</p>
  
  <pre><code>sources = [tips,feed,quotes... etc...
  </code></pre>
  
  <p>I want to pick x number of lists from the master list of lists to use when the program runs. (That's worded kind of funny)</p>
  
  <p>I'm guessing from the comments so far that what I have above would work. With a little more tweaking of the rest of the code, that is.</p>