I guess it makes sence, but I never realized that you can have functions on the left side of an assignment.

array = [1, 2]

def getarray():
    return array

getarray()[1] = 8
print array
Advertisements