(HELP) Stuck on last exercise in Python course
Pretty much as the title says. I'm pretty damn close to the end of the course and am right at the last exercise. I've been trying to solve it for over an hour now, and I still don't have a clear idea of what I have to do to get the result I want. As a brief primer on the exercise, I have to write a function that takes multiple words as its argument via the *args parameter and returns a contcatenated version of those words seperated by dashes, such as "hello-world-!". My first thought was to get all the arguments into a single string and then use regex to swap out all the whitespaces for dashes before printing, but I can't seem to actually get the functions into a single string. I just get the functions as a list, dictionary, or tuple. I've tried a variety of tricks that didn't work, and googling wasn't all that helpful either, so I'm turning to you people for help. Am I missing something? Is my entire approach here just wrong and I should be doing something else? Whatever it is, I hope you can help me here. Either way, here is my code so far (the print statement in the function definition is just for development purposes): def concantenate(word, *args): import re pattern = r"(\w+\s+\w)" words = [word, *args] print(words) print(concantenate("I", "love", "Python", "!"))