image_output_2.png image_output_1.png
def IC(chromosome):
    zeros = 0
    ones = 0
    for i in chromosome:
        if i == '0':
            zeros += 1
        else:
            ones += 1
    return abs(zeros - ones)
IC('0000000111111111111')