How does Python manage memory?
Model answer
Python uses reference counting: each object tracks how many references point to it and is freed when that reaches zero. A cyclic garbage collector also finds reference cycles. You rarely manage memory manually, but you should avoid keeping references to big objects you no longer need.
Learn this topic
Variables, Numbers, Text and input() in Python in the course Python for Beginners: Learn to Code with Real Projects.
Sign in to add your own answer.