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