Python programming language began at the end of 1982 when Guido van Rossum entered the team developing the ABC language. After the termination of the ABC project, he joined the Amoeba OS team while he worked on a simple project on his free time. Python is the result of the work he performed in his spare time. The agenda of this programming language was flexible and general-purpose language. computer science computer science
Python is simple to use, easy to read, and contains multiple programming diagrams like object-oriented, functional, and parallel programming. Also, it is supported by vast groups who have created a variety of open-source libraries centering on Python. A brief list of these third-party libraries include: computer science computer science
1. NumPy: Used for scientific programming such as matrix calculations
2. NLTK: A toolkit for language processing for Python
3. PySerial: Gives the ability to use serial communication
4. PyGame: Helps to build games
5. PyBrain: Helps to build artificial intelligence
Differences between Python and C
Unlike C, Python is a general-purpose programming language and can be used to build anything from a web UI to visual applications. It’s also a dynamic language that can manage memory automatically. On the other hand, since Python’s interpreting level is higher than C, it cannot compete with C in running speed. computer science
However, developing a program using Python may save a lot of time and resources because it is much simpler than C.
In Python, like PHP and Perl, it’s not necessary to define the types of variables. There is no type definition in Python while C needs to know variable types.
For example, in C, defining an integer variable looks like this:
The above line says that “a” is a variable in memory and the size of an integer. However, in Python, we can just declare a variable without mentioning its type:
a=1 computer science computer science computer science computer science computer science
The type of variable is dynamic in Python and can change during run-time. The above code only states that “a” is referencing a part of the memory. The above code is interpreted like this:
1. A part of memory with the size of an integer is created, because Python knows that “1” is an integer.
2. Python saves the name of “a” in another part of the memory.
3. A link is created that says “a” is referencing to “1”.
As I mentioned above Python can manage memory by itself, unlike C. In Python, every variable has a reference number that states the total amount referencing it. After each declaration, Python increases the reference number. After removing it, it decreases the references number. Finally, after the reference number of a variable becomes zero, Python will eliminate the variable from the memory by itself. computer science computer science computer science