List manipulation in functions (11/18)


#1

n = [3, 5, 7]

def list_extender(lst):
lst.append(9)
return lst

list_extender(n) <----------this line in the code is returning the wrong output but if

                                                    line is removed getting right answer, can somebody tell 
                                                    me why a function calling statement is not required 
                                                    here? 

print list_extender(n)


#2

please show the code with format and include the not working code unmodified:

So we can see the indent level, its difficult to see at the moment. Did you place this function call inside the function?


#3

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