You need to write a function that takes multiple words as its argument and returns a concatenated version of those words separat | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

You need to write a function that takes multiple words as its argument and returns a concatenated version of those words separat

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. Sample Input this is great Sample Output this-is-great

24th Dec 2020, 11:51 AM
Nallamala satish
3 Answers
+ 4
Nallamala satish , here are some hints how you could do this task: - use input to get a sentence with multiple words. store it in a variable - split this sentence with function split() at word boundaries and store it in s list - output this list by joining all elements of the list, using "-" as a separator that's all - happy coding!
24th Dec 2020, 1:28 PM
Lothar
Lothar - avatar
0
my_string= input().split() my_string='-'.join(my_string) print(my_string)
2nd Jan 2021, 3:52 PM
abc cba
abc cba - avatar
0
its dhowing none after the putput
12th Feb 2021, 7:01 PM
Reyhan
Reyhan - avatar