Find the total sum of internal angles (in degrees) in an n-sided simple polygon. N will be greater than 2.

Difficulty: introductory

Starter code:

def angle(n):
	

Solutions:
def angle(n):
    return 180 * (n - 2)

def angle(n):
  return (n-2)*180

angle=lambda n:(n-2)*180

def angle(n):
    "Sum angles in N-sided shape"
    return (n - 2) * 180

def angle(n):
    var = n-2
    return 180*(var)

def angle(n):
    if n>2:
        return 180*(n-2)
print (angle(5))

angle=lambda n:180*(n-2)

def angle(n):
    return (n+~1)*180

def angle(n):
    #your code here
    return (n*(n-2)*180)//n

def angle(n):
    if n>2 :
        return (n - 2) * 180
    else: 
        return 'Error'

def angle(n):
    if n == 3:
        return 180
    elif n == 4:
        return 360
    else:
        x = 180*(n-2)
        return x


def angle(n):
    return (n - 2) * 180
    # I googled "formula for angles in a polygon"


def angle(n: int) -> int:
    """This function finds the total sum of internal angles (in degrees) in an n-sided simple polygon."""
    return 180 * (n-2)

def angle(n):
    counter = 3
    if n == 3:
        angle = n * 60
    else:
        n > 3
        angle = (n - 2) * 180
    counter += 1
    return angle


def angle(n):
    ang =  n * 2 
    angg = ang - 4
    sumang = angg * 90
    return sumang


def angle(n):
    if n > 2:
        return abs(n - 2) * 180

def angle(n):
    while n > 2:
        degrees = (n * 180) - 360
        return degrees


def angle(n):
    print(n)
    return 180 * (n - 2)
    #your code here


def angle(n):
    return 180 * (n-2) if n > 2 else None

def angle(n):
    intang = 180*(n-2)
    return intang

import math

def angle(n):
    return 180*n-360

def angle(n):
    
    p = (n-2)*180
    
    return p


def angle(n):
    if n>=2:
        return 180*(n-2) #теорема о сумме углов многоугольника

def angle(n):
    theta = (n-2) * (180)
    return theta

def angle(ip):
    return((ip-2)*180)

def angle(n):
    #your code here (n-2) x 180°
    size = (n-2) * 180
    return size 

def angle(n):
    sum=((2*n)-4)*90
    return sum

def angle(n):
    if n > 2:
        return (n-2) * 180
    else:
        return "not a simple polygon"

def angle(n):
    if n < 2 :
        return 0
    else:
        return ((n - 2) * 180) 

def angle(n):
    if n == 2:
        return 180
    else:
        return (n-2)*180

def angle(n):
    polygon = (n-2)*180
    if n < 3:
        return "not a polygon"
    else:
        return polygon

def angle(n):
    ans = 1440
    ans = (n-2)*180
    return ans

def angle(n):
    return 360*(n-2)/2


# Python3 implementation of the approach 
  
# Function to return the sum of internal  
# angles of an n-sided polygon 
def angle(n): 
    if(n < 3): 
        return 0
    return ((n - 2) * 180) 
  
# Driver code 
n = 5
print((angle(n))) 


def angle(n):
    return ((n - 2) * 360)/2

def angle(n):
    degree = ((n-2)*(180/n))*n
    return round(degree)

def angle(n):
    angle_sum = 180
    return angle_sum * (n-2)

def angle(n):
    if n < 3:
        return "LOL"
    elif n == 3:
        return 180
    else:
        return 180*(n-2)

def angle(n):
    if n == 3:
        s = 180
    if n > 3:
        s = 180 + (n-3) * 180
    return s

def angle(n):
    #your code here
    while n >2:
        return (n-2)*180

def angle(n):
    if n==3:
        return 90+45+45
    return (n-2)*180

def angle(n):
    #your code here
    solution = 180 * (n - 2)
    return solution

def angle(n):
    res = 0
    for i in range(3,n+1):
        res = res + 180
    return res

def angle(n):
    return round(n*((n - 2) * (180 / n)))


def angle(n):
    if n >2:
        s=(n-2)*180
    return s
    #your code here


def angle(n):
    sum_angles = 180
    if n > 2:
        return sum_angles * (n-2)
    return sum_angles

def angle(n):
    if not n>=3:
        return 
    sum = 180
    for _ in range(n-3):
       sum = sum + 180
    return sum

def angle(n):
    #your code here
    result = (n - 2) * 180/n
    return round(result * n)


def angle(n):
    #(n−2)×180°
    return (n-2) * 180


def angle(n):
    n -= 2
    return n * 180

def angle(n):
    t = 0
    if n > 3:
        return (n - 3 + 1) * 180
    elif n == 3:
        return 180 
      
        
           


def angle(n):
    l =(n-2)*180
    return l

import math
def angle(n):
    return 180 *(n-2)

def angle(n):
    return int(((n-2)/n * 180)*n)

def angle(N):
    return 180*(N-2)

def angle(n):
    return int((180 - (360 / n)) * n + 0.5)

def angle(n):
    for multiply in range(n):
       result = 180*(multiply-1)
    return result
    #your code here


def angle(n):
    triangles = n-2
    total_degrees = 180 * triangles
    return total_degrees

def angle(n):
  sum = 0 
  for i in range(3,n+1):
      sum += 180
  return sum   

def angle(n):
    if n>=2:return (n - 2) * 180 

def angle(n):
    k = (n-2)*180
    if n > 2: 
        return k
    else:
        return N/A

def angle(n):
    #your code here
    returnval =  (n-2) * 180
    return returnval

def angle(n):
    return 180 if n == 3 else 180 * (n - 2)

def angle(n):
    x = 0
    for i in range(2,n):
        x += 180
    return x


def angle(n):

    print(n)

    result = (n -2 ) * 180
    
    print(result)
    
    return result

def angle(n):
    if n <= 2:
        return None
    else:
        sum = 180*(n-2)
        return sum

def angle(n):
    if n == 3:
        return 180
    else:
        return angle(n - 1) + 180

def angle(number):
    return 180 * (number - 2)


def angle(n):
    sum_angle = (n-2)*180
    return sum_angle
n = 3
print((angle(n)))
    #your code here


def angle(n):
    if n <=2:
        raise ValueError
    else:
        return 180*(int(n)-2)

def angle(n):
    S=(n-2)*180
    return S
    #your code here


def angle(n):
    angle=n
    return (n-2)*180

import math
def angle(n):
    return ((n-2)*180)

def angle(n):
    #your code here
    return (n-2)*180 if n>2 else 'error'


def angle(n):
    a = 180*(n-2)
    return(a)

def angle(n):
    if n > 2:
        return ((n - 2) * 180)
    else:
        return -1

def angle(n):
    s=180
    p=0
    if n==3:
        return s
    if n>3:
        for i in range (3,n+1):
            p=p+s
    return p

def angle(n):
    '''
    sum = 180(# of sides - 2) 
    '''

    return 180 * (n-2)

def angle(n):
    return round(180*n-360)

def angle(n):
    if n > 2:
        return (n-2)*180
    return None

def angle(n):
    #your code here+
    k = (n-2)*180
    return k

def angle(n):
    if n > 2:
        return int((180 - (360 / n))* n + 0.5)
    else:
        print('error')
        return ''

def angle(n):
    n = n - 2
    n *= 180
    return n

def angle(n):
    return round((180 - 360/n)*n, 0)

import unittest


def angle(n):
    return 180 * (n - 2)
    
    
class TestAngle(unittest.TestCase):
    def test_should_return_180_when_given_n_is_3(self):
        self.assertEqual(angle(3), 180)

    def test_should_return_360_when_given_n_is_4(self):
        self.assertEqual(angle(4), 360)

    def test_should_return_540_when_given_n_is_5(self):
        self.assertEqual(angle(5), 540)


def angle(n):
    x = (n-2)*180
    return x
print((angle(6)))


def angle(n):
    if n == 3:
        a = 180
    elif n >= 4:
        a = 180 * (n - 2)      
    return a

    #your code here


def angle(n):
    #180 * (n-2)
    #return
    nums = 180*(n-2)
    return nums

def angle(n):
    nums = 180*(n-2)
    return nums

def angle(n):
    #your code here
    if n>2:
        return (n-2)*180
    else:
        return none

def angle(n):
    if n < 3:
        return 0
    return ((n - 2)*180)

def angle(n):
    if n < 3:
        print('Has to be a shape, try again')
    elif n == 3:
        return 180
    elif n > 3:
        n = ((n-4)*180 + 360)
    return n

def angle(n):
    #your code here
    if n > 2:
       sum = (n - 2) * 180
    return sum


def angle(n):
    b = ( n-2) * 180
    return b

def angle(n):
    triangleNum = n - 2
    totalInternalAngles = triangleNum * 180
    return totalInternalAngles

def angle(num_sides):
    return (num_sides - 2) * 180  # formula for sum of internal angles of a regular polygon

angle= lambda n: round(n*(180-360/n))

def angle(n):
    test = 180 * (n - 2)
    return test

def angle(n):
    total_sum = (n-2) * 180
    return total_sum

def angle(n):
    return (n-2)*180 #if n==3 else 360
    #your code here


angle = lambda x: 180 * (x - 2)

def angle(n):
    result = 180
    if n > 3:
        for i in range(n - 3): result += 180
    return result

def angle(n):
    if n == 3:
        return 180;
    if n > 3:
        return 180 + (n - 3)*180;
        


def angle(n):
    return (n-2)*180 #if n==2 no polygon

def angle(n):
    return (None, (n - 2)* 180)[n > 2]

def angle(n):
    #your code here
    if n > 2:
        ans = 0
        for i in range(n-2):
            ans = ans + 180
        return ans

def angle(n):
    return n*(n - 2) * 180 / n

def angle(n):
    if n < 3:
       print("no polygon")
    if n >= 3:
       return  (n-2)*180