Skip to content

Commit eb2ff91

Browse files
authored
Size of tuple
1 parent 99cf7d7 commit eb2ff91

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎Size of tuple‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
# sample Tuples
4+
Tuple1 = ("A", 1, "B", 2, "C", 3)
5+
Tuple2 = ("Geek1", "Raju", "Geek2", "Nikhil", "Geek3", "Deepanshu")
6+
Tuple3 = ((1, "Lion"), ( 2, "Tiger"), (3, "Fox"), (4, "Wolf"))
7+
8+
# print the sizes of sample Tuples
9+
print("Size of Tuple1: " + str(sys.getsizeof(Tuple1)) + "bytes")
10+
print("Size of Tuple2: " + str(sys.getsizeof(Tuple2)) + "bytes")
11+
print("Size of Tuple3: " + str(sys.getsizeof(Tuple3)) + "bytes")

0 commit comments

Comments
 (0)