Algorithm to choose number of random numbers from list in python?
Question: I am looking for an efficient way (pseudocode will do) to choose a given
number of values randomly from the list preferably "Pythonic way". Values have
to come from unique indexes of the list

So for example:

    
    
    list = [0,1,2,3,4,5,24]
    
    def choose(number_of_values, list):
        # method
    
    return_val = choose(3, list)
    # return_val = [2, 4, 3]
    


Answer: Its what that
[`random.sample`](https://docs.python.org/2/library/random.html#random.sample)
is for.

    
    
    >>> import random
    >>> random.sample([0,1,2,3,4,5,24],3)
    [2, 24, 5]
    

