Say I have a string tex = "somestring"
I need to create a loop that will create multiple copies of that string, each one with a period added after a character, starting after the first character and ending it before the last
Something like
for i in range (1, len(tex)-2):
tex = ....
print(tex)
The output needs to be:
s.omestring
so.mestring
som.estring
...
somestrin.g
I tried using tex = '.'.join(tex[i+1] for i in range (1, len(tex)-2, 1)) from other questions but that adds a period after every character only once, resulting in s.o.m.e.s.r.i.n.g
Maybe splitting the string into a list of characters would help, but I'm not sure how to approach it from that way.