0
Can someone help me solve the adding words problem this is wat I got so far
def concatenate(*args): for arg in args: print(arg+"-") print(concatenate("I", "love", "Python", "!"))
5 Réponses
+ 4
Something like this ?
def concatenate(*args):
return "-".join(args)
+ 2
If you want to keep the last line your function has to return the concatenated string:
def concatenate(*args):
return "-".join(args)
+ 1
If you don't want to use "join", here is an alternate solution using native loop.
https://code.sololearn.com/c1CqwQVKc6U6/?ref=app
0
Thanks guys