(python)is generating and executing code at runtime considered bad practice?
<p>I'm learning python and i want to learn good practices from the start i had a problem and i came up with a solution that involved generating variables on runtime, this is a sample of what i was doing</p>

<pre><code>for i in range (10):
    current = 'variable'+str(i)+' = '+str(i)
    exec (current)
</code></pre>

<p>So, is doing things like this considered bad practice i know this is a simple example but i can see this getting complicated if you include objects in the mix, i'm bad at determine good readable code from bad one(i'm a newbie after all) so i'm asking you vets if this is frowned upon what are the prefered ways to handle situations like this.</p>
