I need to acces the attribute class through a loop of names. I wonder how can i make it easy.
def dofun():
   class Dict:
       pass
   fun = Dict()
   setattr(fun, X1, 10)
   setattr(fun, X2, 20)
   setattr(fun, X3, 30)
   return fun
def main():
   fun = dofun()
   for i in range(1, 3):
      print(fun.X + i)
      print(globals()['fun.X' + str(i)])
None of the prints works.. Thanks!
 
    