def weighted_choice(population):
    """Randomly select, fitness determines probability of being selected"""
    random_number = random.betavariate(1, 2.5) #increased probability of selecting members early in the list
    #random_number = random.random()
    ind = int(random_number*len(population))
    ind = min(max(ind, 0), len(population)-1)
    return population[ind][0]
def weighted_choice ( population ) : random_number = random . betavariate ( 1 , 2.5 ) ind = int ( random_number * len ( population ) ) ind = min ( max ( ind , 0 ) , len ( population ) - 1 ) return population [ ind ] [ 0 ]
Randomly select, fitness determines probability of being selected