16/18


#1

n = ["Michael", "Lieberman"]

Add your function here

def join_strings(words):
result = ""
for words in n

print join_strings(n)

help me out please?


#2

Your code looks a little bit wrong. I don't see that your function returns result. Also block separation is also absent.

Workable example is:

n = ["Michael", "Lieberman"]

Add your function here

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


#3

how do you add them together?


#4

hey you used the result += words[i] to add them it will go to michael add that to result then go to lieberman and add that to result. Hope that helped


#5

all if you wanna do space in between in michael before the end quote add a space


#6

I don't understand what I am doing wrong?

n = ["Michael", "Lieberman"]
def join_strings(words):
result=""
for i in range(len(words)):
result+=words[i]
return result

Please HELP!!!


#7

I figured it out! I wasn't indenting properly


#8

Could somebody hlep me?
I don't know what is wrong?

n = ["Michael", "Lieberman"]
def join_strings(words):
-tab- result = ""
-tab- for i in words:
-tab-tab- result += words[i]
-tab- return result
print join_strings(n)

Thank you very much.


#9

for i in words: i takes the items inside list and not the index (i="Michael","Lieberman")
result+= words[i] is wrong
the correct answer is result+=i

if you do the iteration with:
for i in range(len(words)): then result+= words[i] is correct

Hope I helped!!!


#10

Thank you very much. Now it is OK.


#11

please tell me this answer ive been stuck for a week and a half...


#12

how about no use git hub it has all the answers
https://github.com/BugraBalci/codecademy-exercise-answers/tree/master/Python/Conditionals%20%26%20Control%20Flow


#13
for i in range(len(words)):
    result = result.join(words)

It works.,
this is the actual code we have to use... should not use + function...


#15

n = ["Michael", "Lieberman"]

Add your function here

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


#16

My code is still returning error message -
n = ["Michael", "Lieberman"]

Add your function here

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

print join_strings(n)


#17

I am wondering about the same thing. I've used (indents are no problem):

`n = ["Michael", "Lieberman"]
def join_strings(words):
result = ""
for words in n:
result += words
return result

print join_strings(n)`

And it's returning MichaelLieberman, but I also get a "Oops, try again. join_strings(['x', 'y', 'z', 'a']) returned 'MichaelLieberman' instead of 'xyza'" error... And I have no idea where is the problem... Maybe you got passed it already and know why?


#18

you should use this code
when you define a function, you should define it as an universal one


#19

Nobody in this thread knows what they are talking about