- 1

Help me to solve a python program

You need to write a function that takes multiple words as its argument and returns a concatenated version of those words separated by dashes (-). The function should be able to take a varying number of words as the argument. Recall, using *args as a function parameter enables you to pass an arbitrary number of arguments to that function.

16th Oct 2020, 2:37 AM
CHAKKA VENKATA NAGA SAI JYOTHIRMAI
CHAKKA VENKATA NAGA SAI JYOTHIRMAI - avatar
6 Respostas
+ 3
If you don't want to use "join", here is an alternate solution using native loop. https://code.sololearn.com/c1CqwQVKc6U6/?ref=app
15th Dec 2020, 7:42 PM
Lam Wei Li
Lam Wei Li - avatar
0
Give it a shot and post the code! We'd be glad to help
16th Oct 2020, 2:38 AM
Slick
Slick - avatar
0
Yea show your attempt
16th Oct 2020, 2:39 AM
Sâñtôsh
Sâñtôsh - avatar
0
def concatenate(*args): print('-'.join(args)) print(concatenate("I", "love", "Python", "!"))
16th Oct 2020, 3:47 AM
CHAKKA VENKATA NAGA SAI JYOTHIRMAI
CHAKKA VENKATA NAGA SAI JYOTHIRMAI - avatar
0
I got the answer
16th Oct 2020, 5:52 AM
CHAKKA VENKATA NAGA SAI JYOTHIRMAI
CHAKKA VENKATA NAGA SAI JYOTHIRMAI - avatar
0
i got answer
25th Nov 2021, 5:22 AM
Smita Wangikar
Smita Wangikar - avatar