0
string formatting in python.............?? HOW
print(", ".join(["spam", "eggs", "ham"])) OUTPUT "spam, eggs, ham" # ( , ) is already a part of string so what does the join() do..?? print("spam, eggs, ham".split(", ")) #prints "['spam', 'eggs', 'ham']
3 Réponses
+ 1
I see it created one string out of three. What do you want the output to look like?
0
", ".join puts (, ) between the elements. if you want the elements to be fully merged, delete both comma and space.
"".join()
0
hii