Strings in list functions.. help!


#1



Traceback (most recent call last):
File "python", line 11, in
File "python", line 7, in join_strings
TypeError: 'list' object is not callable

What am I doing wrong?? why can't I pass the list as argment?


`python

Replace this line with your code.
n = ["Michael", "Lieberman"]

Add your function here

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

print join_strings(n)


#2

n = ["Michael", "Lieberman"]

Add your function here

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

print join_strings(n)

repasting code to make it clearer..


#3
[ ]    # index subscript or list
( )    # function argument or tuple

#4

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