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

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -