You can use the .join()
method of strings and argument expansion to do this!
def add_words(*words):
return "+".join(words)
>>> add_words("foo", "bar", "baz")
'foo+bar+baz'
Note that the .join()
method is actually being used from the string "+"
, rather than the argument words
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…