I need to write some code for making a double space between 1-2 words, triple space between 2-3, then double again followed by triple and so on.
I came up with this code:
a = 'one two three four'
and I want to get this: "one two three four"
print ' '.join(a.split()[0:2]), ' ', ' '.join(a.split()[2:3])
this partially works because -
it does not return the last string from the list 'four' , i tired [2:0], [-1:-3], but it did not work
and the whole code is not automated at all - the spaces are specified manually
if anybody has a solution I would like to hear thanks!