input: Write a python function to create a Polygon class and calculate the perimeter of the polygon.
  assert Polygon(3).perimeter() == 0
  assert Polygon(4).perimeter() == 0
  p = Polygon(3)
  p.input_sides([3, 4, 5])
  assert p.perimeter() == 12
  q = Polygon(4)
  q.input_sides([2, 2, 2, 2])
  assert q.perimeter() == 8
output: def Polygon(sides):
      class Polygon:
          def __init__(self, num_sides):
              self.num_sides = num_sides
              self.side_lengths = [0] * num_sides
          
          def input_sides(self, lengths):
              if len(lengths) == self.num_sides:
                  self.side_lengths = lengths
          
          def perimeter(self):
              return sum(self.side_lengths)
      
      return Polygon(sides)