For the last n bits , we have to carry it out normally as increased value of pick will cause Index Out of Bounds .
if tmp [ 0 ] == '1' : NEW_LINE INDENT tmp = xor ( divisor , tmp ) NEW_LINE DEDENT else : NEW_LINE INDENT tmp = xor ( '0' * pick , tmp ) NEW_LINE DEDENT checkword = tmp NEW_LINE return checkword NEW_LINE