Please refer below post for details of this function https : www . geeksforgeeks . org / toggle - bits - significant - bit /
def togglebit ( n ) : NEW_LINE INDENT if ( n == 0 ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT DEDENT