import random


def crossChrom(chrom1, chrom2):
    """Take two chromosomes and create two new ones.
    
    INPUTS:
        chrom1: tuple of 1's and 0's, same length as chrom2
        chrom2: tuple of 1's and 0's, same length as chrom1
        
    OUTPUTS:
        c1: new list of 1's and 0's, same length as chrom1 and 2
        c2: ""
    """
    # Force chromosomes to be same length
    assert len(chrom1) == len(chrom2)

    # Randomly determine range of crossover
    r = range(random.randint(0, len(chrom1)), len(chrom1))

    # Initialize the two chromosomes to be copies of 1 and 2, respectively
    c1 = list(chrom1)
    c2 = list(chrom2)

    # Loop over crossover range
    for k in r:
        # Note that random() is on interval [0.0, 1.0). Thus, we'll
        # consider [0.0, 0.5) and [0.5, 1.0) for our intervals. 
        # Note that since we initialized chrom to be a copy of chrom1, 
        # there's no need for an else case.
        if random.random() < 0.5:
            # Crossover.
            c1[k] = chrom2[k]
            c2[k] = chrom1[k]

    # Return the new chromosomes
    return [tuple(c1), tuple(c2)]