Python is a general purpose high level programming language which is very much used today.It is now very much popular because of its simple "looking" features. It has much simple syntax as compared to other programming languages which looks rather sophisticated.
Key concepts of Python:
DYNAMIC TYPING
Dynamic typing helps us to declare variables without referring to its type, this is not possible in languages like C....
For example if you have to declare a integer variable in C language you have to explicitly give that it is of th type "int"
int a=3;
whereas in python
>>> a=3
>>>type(a)
>>> <type 'int'>
here we can see that python knows that a is of type "integer".
AUTOMATIC MEMORY MANAGEMENT
Python automatically deallocates or returns the memory which was allocated for some purpose back to the RAM once it is not accessible or once the "REFCOUNT" is 0.
In languages like C, C++ u have to explicitly call the function "free()" to deallocate the memory space.
And if the memory is not deallocated or freed it would create serious problem and cause the program to "CRASH".
This is called a "memory leak" . Often while writing codes in C and C++ programmers forget to deallocate the memory space, while python reduces the burden over the programmers by AUTOMATIC MEMORY MANAGEMENT
Key concepts of Python:
- Dynamic Typing
- Automatic Memory Management
DYNAMIC TYPING
Dynamic typing helps us to declare variables without referring to its type, this is not possible in languages like C....
For example if you have to declare a integer variable in C language you have to explicitly give that it is of th type "int"
int a=3;
whereas in python
>>> a=3
>>>type(a)
>>> <type 'int'>
here we can see that python knows that a is of type "integer".
AUTOMATIC MEMORY MANAGEMENT
Python automatically deallocates or returns the memory which was allocated for some purpose back to the RAM once it is not accessible or once the "REFCOUNT" is 0.
In languages like C, C++ u have to explicitly call the function "free()" to deallocate the memory space.
And if the memory is not deallocated or freed it would create serious problem and cause the program to "CRASH".
This is called a "memory leak" . Often while writing codes in C and C++ programmers forget to deallocate the memory space, while python reduces the burden over the programmers by AUTOMATIC MEMORY MANAGEMENT






0 comments:
Post a Comment