title: how to make create a random combination of fixed lenght using python
body: <p>I want to make a list of a fixed amount of values from random elements of a list. I get an error whit this assumption: </p>
  
  <pre><code>import random                                                               
  
  ALL_COLORS = ("red", "green", "blue", "yellow", "orange", "white")          
  
  
  def create_combination(nb_elements):                                        
      i = 0                                                                   
      combination = ""                                                        
      while i &lt; nb_elements:                                                  
          combination += random.choice(ALL_COLORS)                            
          i += 1                                                              
      print(combination, sep=", ")                                            
      return (combination)                                                    
  
  
  for i in range(10):                                                         
      combination = create_combination                                        
      assert len(combination) == i    
  
  for color in combination:                                               
      assert color in ALL_COLORS                                          
  </code></pre>