Supose I have such variables: var1, var2, var3, var4, var 5, ..., var100 (lists and dictionaries are not suitable in my case, because all these vars are class objects).
I must process all them in similar way, for example:
if var1:
print 'var1 is not None'
if var2:
print 'var2 is not None'
if var3:
print 'var3 is not None'
...
if var100:
print 'var100 is not None'
In such way I will write 200 hundreds lines of code...
But maybe there is some way to process all of them in for statement, like:
for i in range(1,101):
if var%s % i: #I know this is not right, but idea is understood
print 'var%s is not None' % i
So I will write only 3 lines of code.
Is it possible do in Python?
Thanks!