0

What is the Python core practice answer?

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

30th Sep 2021, 9:02 AM
Aydin
Aydin - avatar
8 Answers
+ 6
Aydin Cyber , Eashan Morajkar , Nick before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. put your code in playground and link it here. â–Șit does not really help the OP if we give him code samples before he has done a try by himself first. â–Șit is more helpful to give hints and guide the OP to get the task solved. thanks you all for helping us!
30th Sep 2021, 10:47 AM
Lothar
Lothar - avatar
+ 4
Oh my god, what's with all these dislikes on Eashan Morajkar and my examples
30th Sep 2021, 6:18 PM
Tim
Tim - avatar
+ 4
I thought this section was meant for “discussion” instead of “judgement”, with all due respect.
30th Sep 2021, 6:20 PM
Tim
Tim - avatar
+ 3
If you're gonna go about rules, stop mentioning people with anything that's not programming related because they didn't come here to get a lecture on how to live a life when they came here to learn to code It is somewhat annoying, aggravating and harassing to be mentioned in situations like this when it is uncalled for Maybe spend more time appreciating people's efforts instead of picking out any wrongs that you spot?
30th Sep 2021, 7:12 PM
Tim
Tim - avatar
+ 1
I'm not sure what “input()” would return if nothing is given, but I guess you could try something like: inputs = [] while True: #if input() is null or something break inputs.append(input)) output = "-".join(inputs) Not an expert on python but I hope this helps
30th Sep 2021, 9:16 AM
Tim
Tim - avatar
0
Aydin Cyber: inputs = [] i = "" while True: i = input() if i=="": inputs.pop() break inputs.append(i) inputs.append("-") for i in inputs: print(i,end="")
30th Sep 2021, 9:52 AM
Eashan Morajkar
Eashan Morajkar - avatar
0
Thanks ♄♄♄♄♄
30th Sep 2021, 10:01 AM
Aydin
Aydin - avatar
0
You're welcome
30th Sep 2021, 10:01 AM
Eashan Morajkar
Eashan Morajkar - avatar