I am confused about the usage of string.join(list) instead of list.join(string), for instance see this code:
my_list = ["Hey", "Fish"]
print my_list.join("-")
# Produce: "Hey-Fish"
I think this code seems nicer than this one:
my_list = ["Hey", "Fish"]
print "-".join(my_list)
# Produce: "Hey-Fish"
Can someone tell me the reason behind this?
Select the correct answer from above options