Recently I have made a connect 4 game in python. Since I'm a beginner I was trying to find a way to create my counter objects when I need them instead of having to make a lot of them individually at the start of the game. I found that an exec statement works.
exec("counter%d = Counter(board,[%d,%d],'player','counter%d')" %
(len(counters)+1,current_heights[row],row,len(counters)+1)) in globals(), locals()
I haven't had any problems with it but It seems like the kind of thing that would be called bad programming by better programmers.