'' use to toggle sign in sequence.
toggle = 1 NEW_LINE for i in range ( 0 , n + 1 , 2 ) : NEW_LINE INDENT ans = ans + nCr [ n ] [ i ] * ( cosTheta ** ( n - i ) ) * ( sinTheta ** i ) * toggle NEW_LINE toggle = toggle * - 1 NEW_LINE DEDENT return ans NEW_LINE