This may be convoluted/unsafe, but I'd appreciate if someone could let me know if there is a way to do the following in Python or not.
1) Using a list of strings (henceforth called the alpha list), I would like to create other list variables named after the strings.
2) I'd like to be able to manipulate (but primarily append values to) these new list variables without calling them explicitly, i.e. calling them using the alpha list's indexes so that I can run them through a loop.
Below I'll provide code that hopefully conveys more clearly what I'm trying to do.
#1
alphaString = ['a', 'b', 'c', 'd', 'e']
for letter in alphaString:
letter = []
#2
rowOfValues = ["alpha", "bravo", "charlie", "delta", "echo"]
#Length of rowOfValues supposed to be same length as alphaString
#There would be many rows being run through a bigger loop that includes this code, but I'll keep it to just this one row for simplicity
for i in range (0, len(alphaString)):
if rowOfValues[i] not in alphaString[i]: #Ex. if "alpha" not in list a
alphaString[i].append(rowOfValues[i]) #Ex. a.append("alpha")
Is what I'm trying to do not possible with Python, or am I just going about it the wrong way? Thank you!