I have a situation where
if len(a) = 0
a = ''
if len(b) = 0
b = ''
if len(c) = 0
c = ''
If len( any object) is zero , declare it as null. I have to keep doing this for all the alphabets . What is the best way to code it.
Additional information :
import test2
x = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'] # a b c are declared in test2 file as a = set()...b = set() ...
for y, z in enumerate(x):
if len(getattr(test2, x[y])) >= 5:
setattr(test2, x[y], '') = ''
else:
pass
Why am I not able to use setattr there?