Help in exercse 16


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'


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.


Thanks alot ! My Problem got fixed. :slight_smile:


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