10/18 Return Function


#1

Perhaps it is my lack of understanding the relationships in a return function but why do I want to return X at this end of this function?

def list_function(x):
x[1] = x[1] + 3
return x


#2

So that the caller can get the result back.
Though in this particular case, they already have it because it’s the same value as the one they sent in (you’re not creating a new value, you’re modifying the one given to you)


#3

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