DRY way to declare several similar form fields
<p>Let's say I'm trying to declare a (django) Form class with several FileFields:</p>

<pre><code>class = MyForm(forms.Form):
    file_0 = forms.FileField()
    file_1 = forms.FileField()
    ...
</code></pre>

<p>I have about 20 sequential inputs to declare - what's the best way to avoid typing this all out like a chump?</p>

<p>Use a loop:</p>

<pre><code>files = [forms.FileInput() for i in range(20)]
</code></pre>

python django