Posts

Showing posts from October, 2019

Python tutorial -- #2 (Garbage Collector, Comment, Variables and Datatypes)

Image
Python tutorial GARBAGE COLLECTOR (GC) Module =  A module is a code that can perform an specific task. >>> In Python GC (Garbage Collector) is a module that helps to remove the unwanted things during the execution. When a program execution takes place GC generate a reference count to each object. Reference count means how many times the object execute. when an object has reference count of at least 1 then GC do not removes them but when an object has reference count of 0 then GC understands that object has not any use in program and GC removes them. Python tutorial In the given figure A, B and C are three object. when we execute this program then Python interpreter interprate from A object to B object and then execute C after that it passed to A object. Thus, A, B and C has reference count of 1. So, GC not removes them. COMMENT Observe the given program :- The First line of this program starts with #. This symbol represents comment line . C