PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Created by Edward Finkelstein
#challenge question by ankush_953
def guess(list1):
list2 = list1
list2.append (4)
print(id(list1))
list1.append(3)
print(id(list1)) #this id will be same as above because references are same.
list1 = [5, 6, 7] #it will behave as a local variable and its id will be different than referenced variable which is also list1
print(id(list1))
list1 = [1, 2, 3]
guess(list1)
print (sum(list1))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run