Home > Blockchain >  Join two word in a item from a list python
Join two word in a item from a list python

Time:01-16

I have this list:

['Fantasy', 'Young Adult', 'Paranormal', 'Paranormal Romance']

Is it possible to join the two words in an item like 'Young.Adult'

I mean in general, not for that two words(the list only contains max two words).

CodePudding user response:

That should do it:

for word in ['Fantasy', 'Young Adult', 'Paranormal', 'Paranormal Romance']:
    print(word.replace(" ", "."))
  •  Tags:  
  • Related