Skip to content

Commit 1071875

Browse files
author
Philip Guo
committed
altered aliasing example
1 parent 6f2e341 commit 1071875

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

example-code/aliasing.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Example of aliasing
1+
x = [1, 2, 3]
2+
y = [4, 5, 6]
3+
z = y
4+
y = x
5+
x = z
6+
27
x = [1, 2, 3]
38
y = x
49
x.append(4)
@@ -8,11 +13,12 @@ x.append(6)
813
y.append(7)
914
y = "hello"
1015

11-
def foo(lst): # breakpoint
16+
17+
def foo(lst):
1218
lst.append("hello")
1319
bar(lst)
1420

15-
def bar(myLst): # breakpoint
21+
def bar(myLst):
1622
print myLst
1723

1824
foo(x)

0 commit comments

Comments
 (0)