Python Programming: Need to add spaces between character in a split string -


i have print out every third letter of text spaces between , none @ end. can spaces between each of letters.

here have.

line = input('message? ')                                           print(line[0]+line[3::3].strip()) 

to join things spaces, use join(). consider following:

>>> line = '0123456789' >>> ' '.join(line[::3]) '0 3 6 9' 

Comments

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -