I wish to create list of each element of a list.
what I want is:
if cities = ["detroit" , "chicago" , "portland"];
then create 3 lists:
detroit = [""];
chicago = [""];
portland = [""];
I wish to create list of each element of a list.
what I want is:
if cities = ["detroit" , "chicago" , "portland"];
then create 3 lists:
detroit = [""];
chicago = [""];
portland = [""];
That is not a good idea, but that's your decision. This will do what you want.
cities = ["detroit" , "chicago" , "portland"]
if cities == ["detroit" , "chicago" , "portland"]:
for city in cities:
exec("{} = [\"\"]".format(city))