16/18


#1

I'm really stuck... the question is:

Create a function that concatenates strings.
Define a function called join_strings accepts an argument called words. It will be a list.
Inside the function, create a variable called result and set it to "", an empty string.
Iterate through the words list and append each word to result.
Finally, return the result.

I put

n = ["Michael", "Lieberman"]

Add your function here

def join_strings(words):
result=""
for n in range(len(words)):
result+=words[n]
print join_strings(n)

and got it wrong


#2

Please format your code. You can do that by highlighting all of your code while editing / creating a post, and clicking the </> button in the formatting bar above the textarea. We have to spend few extra seconds / minutes guessing how lines of your code are indented.

You should return created string:

n = ["Michael", "Lieberman"]

# Add your function here
def join_strings(words):
    result=""
    for n in range(len(words)):
        result+=words[n]
    return result

print join_strings(n)

#3


#4

I appreciate the clue. I would like to know what line 6 is doing, though. Thanks :smiley:!


#5

what line 6 is doing is its getting the element in the list (Michael and Lieberman). hope that helps


#6

Factoradic...Thank you for your response. It is the ONLY one that I have read over several posts that clearly demonstrates iteration through the CORRECT list and summation USING that list that I have seen thus far. I would like to build a team of coders that know what they are doing here on Codecademy and you are definitely one that has shown UNDERSTANDING and not just KNOWLEDGE. Thanks again and Keep coding!!!