[ create a new paste ] login | about

Link: http://codepad.org/2971OEwu    [ raw code | output | fork ]

Python, pasted on May 27:
1
2
3
4
5
6
7
8
def test(lst):
    lst[0] = 'test'
    print 'inside', lst

lst = [0,0,0,0]
print 'before', lst
test(lst)
print 'after', lst


Output:
1
2
3
before [0, 0, 0, 0]
inside ['test', 0, 0, 0]
after ['test', 0, 0, 0]


Create a new paste based on this one


Comments: