When joining a list in python, join
is a function of a str
, so you would do
>>>', '.join(['abc', '123', 'zyx'])
'abc, 123, zyx'
I feel like it would be more intuitive to have it as a property of a list
(or any iterator really),
>>>['abc', '123', 'zyx'].join(', ')
'abc, 123, zyx'
Why is this?