def mutate(chrom, rate=100):
    """Randomly mutate a chromosome.
    
    Rate is the chance in 100 that mutation will occure."""
    for i in range(len(chrom)):
        chance = randint(0, 100)
        if chance <= rate:
            chrom[i] = randint(0, 13)
    return chrom
Randomly mutate a chromosome.
    
    Rate is the chance in 100 that mutation will occure.
recipes/Python/498257_Simple_functibase_Genetic/recipe-498257.py