PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
# in case we wanted to check if 2 objects are the `same` we can use the `id()` built-in function.
# create a new ist:
lst1 = ['a', 'b', 3]
print(f'creating new list {id(lst1) =}\n')
lst2 = lst1
print(f'list copy using `=` {id(lst2) =}\n')
# create a copy of lst1 by using list method `copy`
lst3 = lst1.copy()
print(f'list copy using copy() {id(lst3) =}')
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run