List manipulation (11/18)


How is it that Python knows that I want to manipulate the list outside of the function? What if I had two lists outside of this function? What kind of magicry is this?

n = [3, 5, 7]

def list_extender(lst):
return lst

print list_extender(n)


You told it to.
You made a list named n
Then made a function that takes a list and adds 9 to it
You printed the result of calling that function on your list n


Thank you! I guess I was just overthinking it.


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