Check if an N | Function to check if the polygon exists or not ; Initialize a variable to store the sum of angles ; Loop through the array and calculate the sum of angles ; Check the condition for an N - side polygon ; Driver Code ; Given array arr [ ] ; Function Call
def checkValidPolygon ( arr , N ) : NEW_LINE INDENT Sum = 0 NEW_LINE for i in range ( N ) : NEW_LINE INDENT Sum += arr [ i ] NEW_LINE DEDENT if Sum == 180 * ( N - 2 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT N = 3 NEW_LINE arr = [ 60 , 60 , 60 ] NEW_LINE checkValidPolygon ( arr , N ) NEW_LINE