Hi Friends,
I am completely new to coding & learning python from a book at home. So I have started from ABSOLUTE ZERO. Never done coding before in my life.
Right now I am at learning split() and join().
Question: When we precede a string value and .join(argument) - argument being a list, the 1st value in the list is not being joined with the string value. Can any knowledgeable people explain why?
For example:
thank you very much for your time.
I am completely new to coding & learning python from a book at home. So I have started from ABSOLUTE ZERO. Never done coding before in my life.
Right now I am at learning split() and join().
Question: When we precede a string value and .join(argument) - argument being a list, the 1st value in the list is not being joined with the string value. Can any knowledgeable people explain why?
For example:
phal = ['apple', 'banana', 'mango', 'orange'] desc = ' fruits. '.join(phal) print(desc)Result I get:
Output:apple fruits.banana fruits.mango fruits.orange
So why isn't 'fruits.' not preceding 'apple' also and is only joining to the other 3 items in the list. thank you very much for your time.