World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITian's, only for AI Learners.
Download our e-book of Introduction To Python
4 (4,001 Ratings)
218 Learners
Balasaheb Garule
6 months ago
static int n = 30; #static memory management in python
#dynamic memory management in python
int * d;
d = new int;
def display():
str1 = “insideaiml” # ref count + 1
print(str1)
display()
# ref count -1
# insideaiml is out of scope
import sys
str1 = 'hello'
print(sys.getrefcount(str1))
4
text = "Welcome to insideAIML"
print(text)
Welcome to insideAIML
del(text)
print(text)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'text' is not defined