Function parameters and arguments


in the solution below, how does function know that i am going to use n list and appended 1st into 9 even if i didn’t mention it

n = [3, 5, 7]

def list_extender(lst):
return lst

print list_extender(n)

Which list am I appending to and returning?

because you give n as argument on function call:

print list_extender(n)

so the parameter (lst) then receives the value from argument at function call

so parameters are in essence placeholders until the function is executed/called