x = [1, 2, 3]
y = x
y.append(4)

s = "wow"
t = s
t = t + "za"

###

def foo(lst):
    lst[1] = "!"

x = [1, 2, 3]
print(foo(x))
print(x) # [1, "!", 3]

###

def destructiveDouble(lst):
    for i in range(len(lst)):
        lst[i] = lst[i] * 2 # index assignment is destructive!

x = [1, 2, 3]
destructiveDouble(x)
print(x)

###

def nonDestructiveDouble(lst):
    result = [ ]
    for i in range(len(lst)):
        result.append(lst[i] * 2) # append can be used on result, but not lst
    return result

x = [1, 2, 3]
y = nonDestructiveDouble(x)
print(x, y)
