I have this bit of code:
corpus = "T1T2T3"
for character in corpus:
if character == 'T':
print character + corpus[corpus.index(character) + 1]
I would simply like to print all of the T's and the letters that follow. In this case, it should print T1 T2 T3 -- instead only T1 T1 T1 is being printed. Any idea what might be going wrong?