Count 0 s present at the end
for j in range ( i + n - 1 , i - 1 , - 1 ) : NEW_LINE INDENT if ( s [ j ] == '0' ) : NEW_LINE INDENT ce += 1 NEW_LINE DEDENT else : NEW_LINE INDENT break NEW_LINE DEDENT DEDENT