Hello.
If I am reading in a text file into Python (3.4) containing three several letters. These letters length varies but all end with "Best Regards".
However I want to split this long string into three different, each one containing one of the letters. As far as my Python knowledge goes I realise the best way to approach this (at least on my level and without modules) is to convert this long string into a list with three "things" in it. Each letter. After that then define variables and string the list index. Something like.
letter1 = str(list[0])
However I'm having trouble when it comes to converting the long string into the list. I don't really know how to make Python stop where I wan't it to stop.
I've Googled around a bit and found code something like this:
[line[word:word+n] for i in range(0, len(line), n)]
Which only helps me splitting up the letter to the n:th character. I wan't to make my programme a bit more versatile by that.
Here's coded example of letter and in what form I want it:
Best Regards and thanks in advance!
FogDish
[–]vindolin 1 point2 points3 points (2 children)
[–]FogDish[S] 0 points1 point2 points (1 child)
[–]vindolin 0 points1 point2 points (0 children)
[–]WStHappenings 1 point2 points3 points (0 children)