What is Python ?

For your information, Python is a high-level, interpreted, general-purpose programming language, which is used to develop mobile applications, websites, softwares, etc.
1. Interpreted means that Python programs/codes written in Python language are executed line by line.
2. General-purpose programming language simply means – a computer language that can be used to create almost any kind of software and work. It is not bound to any one specific task.
3. High-level Language: It means that Python code is very close to the language understood by humans (simple English). To write and read it, you do not need to understand the binary language (0 and 1) of the computer.
Python language is also an object-oriented programming language like C language, which means that the speed of Python language is very fast and it is free to create real-life projects. In simple words, Python is a modern computer language that allows to do even the most complex technical tasks in a very straightforward, clean and easy way. Today it has become the most favorite language of programmers and big tech companies around the world.


History And Evolution Of Python

The history and evolution of the Python programming language is one of the most fascinating stories in the world of computer science. What began as a simple hobby project has now become one of the world's most powerful and popular programming languages. Let's explore its journey from its inception to the present day in detail.

1. The origins and background of Python (1980s)

Python originated in the late 1980s. It was developed by Guido van Rossum, a Dutch programmer working at the Centrum Wiskunde & Informatica (CWI) in the Netherlands.
Guido van Rossum was working on a programming language called 'ABC' at the time. ABC was very simple and designed to be taught to non-programmers, but it had some technical shortcomings, such as being difficult to extensible and lacking exception handling. Guido wanted to create a language that was as easy to learn as ABC, but also had powerful capabilities like C and Unix shell scripting.

2. The birth of Python and its first official release (1989–1991)

During the Christmas holidays in December 1989, Guido van Rossum had no major work. He decided to use his time and work on a new project. He began writing an interpreter for a new scripting language, a successor to the ABC language. This project became what we know today as Python.
After nearly a year of hard work, Guido released the first official version of Python (Version 0.9.0) as source code in February 1991. This initial version included object-oriented programming (OOP), classes, functions, and core data types (such as lists, dictionaries, and strings).

3. The unique story behind the name (Why the name 'Python'?)

Many people think the language is named "Python" after the dangerous python snake, but that's not the case at all. In fact, Guido van Rossum loved watching "Monty Python's Flying Circus," a popular British comedy show from the 1970s.
He wanted a name for his new language that was short, a little mysterious, and unique. So he stole the word "Python" from the show's title and named his language "Python."

4. Python 1.0 and its development (1994)

In January 1994, the first major version of Python, Python 1.0, was released. This version added many new and important features that promoted functional programming. It included modern tools like lambda, map, filter, and reduce, which are still very popular among developers today. In 1995, Guido van Rossum continued his work at the Corporation for National Research Initiatives (CNRI) in the US, where he released several more subversions of Python.

5. Python 2.0: The Age of Community and Modernity (2000)

Python 2.0 was released in October 2000. This marked a major turning point in Python's history. The open-source community played a significant role in the development of this version. Python 2.0 introduced several significant features:
1. Garbage Collection : A cyclic garbage collector was added to automatically clean up memory.
2. List Comprehensions : This feature was introduced to make code shorter and more beautiful.
3. Unicode Support : Characters from various languages ​​around the world were supported.

After this version, Python began to become a mainstream language among software developers worldwide.

6. Python 3.0: A New and Difficult Beginning (2008)

Python 3.0 (often referred to as Py3K or Python 3000) was released in December 2008. The main purpose of this version was to completely clean up the code errors and duplication in Python 2.0.
A big risk was taken with Python 3.0—it was "backward incompatible." This meant that older code written in Python 2 could not be run directly in Python 3. For example, in Python 2, print "Hello" was written, whereas in Python 3, it essentially became print("Hello").
This change caused significant difficulties for developers in the early years when converting their old code to the new version. Therefore, the Python community supported Python 2.0 for a long time (until 2020) so that companies could gradually migrate to Python 3. Today, Python 3 has become the standard worldwide.

7. Quitting The Godsfather (2018)

Guido van Rossum was known within the Python community as the "Benevolent Dictator for Life" (BDFL). This meant that Guido always had the final say on what changes would be made to Python. However, in July 2018, after leading the language for nearly 30 years, Guido resigned from this position. Python development is now overseen by a five-member Steering Council.

8. Current situation and future

Today, Python continues to advance with its 3.x version. Its speed and performance are being significantly improved in new versions. Python has become a market leader in cutting-edge fields like artificial intelligence (AI), machine learning, data science, and cloud computing. From a simple hobby project to becoming the world's number one language, Python's journey will be remembered forever.


Why Learn Python Language ?

Why learn Python? This question is common among anyone who wants to enter the world of coding or technology. The simple answer is that Python is currently the most in-demand and versatile language in the world. The main reasons for learning Python are explained below :

Advantages of Python Language

1. Interpreted Language Python is an interpreted programming language. This means that the code in Python is executed line by line. If there is a mistake somewhere in the code, the interpreter stops at that very spot.
2. Libraries If you have to do any work, then libraries are available in Python to complete every task. Python libraries are one of the libraries in the world. Some libraries of Python language are given below. Web-development: Flask Data science: pandas Game - Development: Pygame
3. Easy to Learn Python language is easy to learn, which means that due to the simple syntax of Python language, it is easy to learn Python language. And coding in Python is also easy.
4. Dynamically Typed In languages ​​like C, C++, the type of variable has to be defined separately. But in Python language, the value has to be assigned to the variable, there is no need to define the type of variable separately. For example: a = 10

Applications Of Python Language

Nowadays, Python Programming Language is being used in almost all the fields. Use of Python in some fields is mentioned below :
1. Artificial Intelligence and Machine Learning (AI & Machine Learning) : Python is the number one choice for building today's biggest technologies like Chatbots, Face Recognition systems and AI models. For this, it has tools like TensorFlow and PyTorch.
2. Data Science & Analytics : Companies across the world make their business decisions by analyzing millions of GB of data. Python is most commonly used to clean, understand and create charts/graphs from this data.
3. Web Development : Python is used to build the backend (which handles the server and data) of large websites. For this, popular frameworks like Django and Flask are used.
4. Automation & Scripting : If you have a computer task that you have to perform repeatedly (like renaming hundreds of files daily or extracting data from the internet), a little Python code can automate that task in no time.
5. Software and Game Testing : Python automation tools are widely used to test and find bugs in newly developed software.

Top Companies Using Python

Python also dominates the practical world. The world's largest tech companies rely on Python for their core operations:
Google: Python has been one of Google's core languages ​​since the search engine's inception.
Netflix : Python is heavily used in its algorithms that recommend movies and shows to users based on their preferences.
Instagram : Instagram's entire backend is built on Python's Django framework.
NASA : It is used by space scientists for research, satellite data analysis, and complex calculations.
Spotify : Uses Python to improve music recommendation and radio features.


What is an interpreter?

Interpreter is a software which is used to run programs written in Python language. Computer does not understand human language. Computer understands machine language i.e. 0 and 1, hence interpreter explains the correct meaning of our programs to the computer in machine code (0 and 1).

How does an interpreter work ?

1 Source Code
2 Read
3 Byte Code
4 Output
5 PVM

You already know that Interpreter explains our written programs to the computer. To do this, Interpreter follows some steps which are defined below : -
Step 1. Whenever a program is written, Python Interpreter reads that code line by line and Interpreter converts that code into machine code.
Step 2. When Interpreter converts the code into machine code i.e. Bytecode , then it gives this Bytecode to PVM (Python Virtual Machine) .
Step 3. After this PVM executes/runs the entire code line by line and gives the output.

What is a compiler ?

Computer does not understand human language, it understands 0 and 1, hence to explain the codes / programs written in any programming language to the computer, an interpreter or compiler is used. Compiler is a computer program which is used to convert the programs written by us into machine code. Compiler works exactly opposite to the interpreter, that is, instead of executing the written programs line by line, the compiler reads the entire program at once.

How does the compiler work ?

1 Source Code
2 Scanner
3 Semantic Analysis
4 Code Generate
5 Machine Code

1. Source Code = > This is the first step in which the code is written by the programmer, that is, the source code is what the programmer writes.
2. Scanner = > This is the second step in which the compiler divides the source code into small parts like: int → keyword a → identifier, = → operator. If there is any spelling related mistake in this step, then the compiler gives an error.
3. Syntactic Analysis = > This is the third step in which the compiler checks the errors related to grammar, declared variables, etc. in the written program. If any error is found, the output of the entire program is not available.
4. Generate Code = > This is the fourth step of the compiler in which the compiler makes the code better and faster so that it takes less memory.
5. Machine Code = > This is the last step of the compiler in which after completing all the steps, the compiler converts the codes written by the programmer into machine code (0 and 1) which the computer can run directly.

Difference between Interpreter and Compiler

Interpreter Compiler
1. Line By Line execution 1. Full Program Execution
2. Execution Slow 2. Execution Fast
3. Direct Run 3. Compile Run
4. Does not generate any file. 4. Generates .exe file.
5. C / C++ 5. Python , JavaScript

What kind of language is Python ?

Python is an interpreted language because code execution in Python happens line by line, hence Python is called an interpreted language but if seen technically then Python is a combination of both interpreted and compiled, in such a case Interpreter does not create any extra file for Machine Code, whereas Compiler creates an extra file. When we write Python code, it is not run directly. The execution process of the written program happens like this.
.py (source code) → bytecode (.pyc)
This process is called Compilation. And .pyc file is created in the process, in this way Python is a compiled language. But code execution happens line by line, hence Python is both interpreted and compiled language.
NOTE: Python is neither a fully interpreted language nor a fully compiled language Python = (Compiled + Interpreted)


What is IDE Language ?

The full name of IDE is Integrated Development Environment . IDE Languages ​​are such languages ​​which provide such an environment for programming in which there is no need to go from one place to another to create projects, rather all the work can be done at one place. Python is also an IDE Programming Language, which provides us Integrated Development Environment for programming. place and run at the same place. Due to Python being an IDE Language, the user gets benefits like saving more time, getting a good experience. HTML, CSS, JavaScript are some such languages ​​whose codes are written in the editor and the outputs are seen on the browser. By using IDE Language, the user gets many benefits like
1. Auto Suggestions => Because a separate code editor like Vs Code can be used with the IDE language and the user gets auto suggestions in the vs code editor.
2. Mistakes => While programming in IDE language, code editors like Vs Code automatically point out errors like spelling mistakes.
3. Indentation => Indentation is very important in Python language, without indentation the interpreter gives error, hence indentation can be done easily by using code editors like Vs Code along with IDE language.
4. Time saving => Everything is available in one place in IDE language, hence a lot of time is saved.

Text Editor vs IDE

What's the difference between Notepad and an IDE? You can explain it with a small distinction:
टेक्स्ट एडिटर (जैसे Notepad, Notepad++) : This is just a place for typing. You can write code in it, but it can't execute the code or find errors.
IDE (जैसे PyCharm, VS Code) : This is a complete workshop. You can write code in it, run it with one click, and also fix bugs immediately.

Core Components of an IDE

1. Source Code Editor: Where developers type their code.
2. Compiler/Interpreter: Converts the code into computer-understandable language (zeros and 1s) so the program can run.
3. Debugger: A tool that acts as a detective, examining each line of code to uncover hidden bugs.

Popular IDEs Examples

1. PyCharm & Jupyter Notebook: Specifically for Python and data science.
2. Visual Studio Code (VS Code): This Microsoft tool is the most popular today for every language (Python, JavaScript, C++).
3. Android Studio: The official tool used to create mobile apps (Android Apps).
4. Eclipse & IntelliJ IDEA: Primarily the first choice for Java developers.


First Python Program

print("Hello, World!")
Code Output
Welcome to Python 3.12

How does this code work ?

print(): This is a built-in function of Python. Its job is to display the text typed in it as output on the computer screen.
Double Quotes ("..."): Python treats anything written inside quotes as a string, i.e., plain text, and prints it as is on the screen.

How to Run This Python Program ?

Method A: Using IDLE or VS Code (by creating a file)
1. Open your code editor (such as Notepad, VS Code, or IDLE).
2. Type the line above: print("Hello, World!")
3. Save this file as hello.py (remember, Python file extensions should always be .py).
4. Go to your terminal or command prompt (CMD) and go to the folder containing this file and type this command: python hello.py
5. The output will appear on the screen: Hello, World!
Method B: Using Interactive Mode (without creating a file)
1. Open your computer's Terminal (Mac/Linux) or Command Prompt (Windows).
2. Simply type python and press Enter. This will open the Python interactive shell (where >>> appears).
3. Now simply type: print("Hello, World!") and press Enter. You will immediately get the output below.