Python join: why is it string.join(list) instead of list.join(string)? -


It always confuses me It looks like this would be good:

  my_list = ["Hello", "world"] print my_list.join ("-") # Product: "Hello-world"  

From:

  My_list = ["Hello", "World"] Print "-" Include (my_list) # Product: "Hello-World"  

Is there any specific reason?

it is

EG:

  Import urllib2 print '\ n ### No duplication can be included, not just lists, but result and "adder" are always string. ######### \ n'.join (urllib2.urlopen ('http://data.stackexchange.com/users/7095'))  

Comments