8. pa's'sing a list to a function


#1

Question:


def list_function(x):
    return x
n = [3, 5, 7]
print list_function(n) --> <Here x is replaced by n? or does it still exists after this line?>

#2

x is representing the one argument that function is intended to take. So when you call the function you replace x with n so that it performs the function on the list n.


#3

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