Skip to content

Commit e768b3e

Browse files
16LessonMemoryAllocation
1 parent 430f39d commit e768b3e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

16lesson.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Memory address
2+
p = 10
3+
e = 10
4+
5+
t = id(p)
6+
y = hex(p)
7+
8+
w = id(e)
9+
v = hex(e)
10+
11+
# print(p)
12+
# print(t) #decimal value
13+
# print(y) #hex value
14+
# print(v)
15+
# print(w)
16+
17+
if t == w :
18+
print('Same Memory',t,w)
19+
else:
20+
print('Different memory allocation',t,w)
21+
22+

0 commit comments

Comments
 (0)