if I have a list, say:
ll = ['xx','yy','zz']
and I want to assign each element of this list to a separate variable:
var1 = xx
var2 = yy
var3 = zz
without knowing how long the list is, how would I do this? I have tried:
max = len(ll)
count = 0
for ii in ll:
varcount = ii
count += 1
if count == max:
break
I know that varcount is not a valid way to create a dynamic variable, but what I'm trying to do is create var0
, var1
, var2
, var3
etc based on what the count is.
Edit::
Never mind, I should start a new question.