Is there a way to cycle through a group of variables with similar names using a for loop in python?
An example (from the nltk library): I have a group of variables called text1, text2, text3, ..., text9, and I want to do certain operations to all of them without having to explicitly type their names each time, so I'm looking for a way to loop through them like this:
for x in range(1, 9):
text + x.someFunction()
I know this is not allowed, but is there a way to do something like that?