Help in exercse 16


#1

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

gives an error

Oops, try again. join_strings(['x', 'y', 'z', 'a']) returned 'x' instead of 'xyza'


#2

Without a properly formatted post we cannot see your indentation, but I'm willing to be that the return statement is indented too much and is inside the loop.


#3

Thanks alot ! My Problem got fixed. :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.