This works in the context of the lesson [Codecademy].
n = ["Michael", "Lieberman"]
# Add your function here
def join_strings(lst):
concat = ""
for string in lst:
concat += string
return concat
However, when I do this in regular Python, outside of the Codecademy environment, and I pass multiple arguments to the function, it returns an error. I was wondering how to make sure that the parameter of the function is a list. This way, I can pass however many arguments I want and the function will simply understand that this is a list.
Note, I do not want to do this with *args
or something similar. I was simply wondering if there's a way to pass an actual list into a function.
Would you have to do something like a dictionary?