title: How to repeat a function in Python (complete beginner - first lines of code ever)
body: <p>I have the following code which I have to build upon (i.e. it can't be written a different way). I know there are other better ways of achieving the end result, but I want to use this code and then repeat it to make a list.  </p>
  
  <pre><code>from random import choice
  number_list = range(1,1001)  # Creates a list from 1 to 1000
  random_from_list = choice(number_list)  # Chooses a random number from the list
  </code></pre>
  
  <p>I want to now repeat the choice function above 100 times, then print that list of 100 random numbers that I have chosen from my list of 1000 numbers. I have read up on "for" loops but I can't see how to apply it here. </p>