title: how can i create a class inside a loop
body: <h1>Experiment</h1>
  <pre class="lang-py prettyprint-override"><code>class calculator:
      class add:
          def __init__(self,*arg):
              self.arg = arg
              
          def display_new(self):
              return sum(self.arg)
              
      class multiply:
          def __init__(self,*arg):
              self.arg = arg
          
          
          class multi_num:
              def __init__(self,*arg):
                  self.arg = arg
              
              def nature(self):
                  sum = 1
                  for x in arg:
                      sum=sum*x
                  return sum
        
      class devide:
          def __init__(self,x,y):
              self.x = x
              self.y = y
              
          def display3(self):
              try:
                  result = self.x/self.y
              except ZeroDivisionError:
                  print(&quot;error: divided by zero&quot;)
              else:
                  return (result)
              
  calc = calculator()
  
       multiply = calc.multiply(1,2,3,4,5)
       multiply.display2()
  </code></pre>
  <p>its not displaying the result. how can I fix this and where am I making mistake ,add and divide is working properly but I don't know why this multiply is not working.</p>