If I have a list of strings and I want to gather the position of each character in the string, what would be the best way? For example, if I had a list:
text = []
stopword = ""
while True:
line = raw_input()
if line.strip() == stopword:
break
text.append(line)
text = ['fda', 'adf', 'esf', 'esfe']
and I wanted to create something like:
newlst = ['faee', 'ddss', 'afff', 'e']
Is there a simple way? I'm creating multitudes of for
loops and it seems convoluted.