Introduction to Python
Python is an open source programming language and is considered one of the most famous and widely used languages with a high level of protection. Python is considered one of the dominant languages in the world with the renaissance of artificial intelligence and is also considered a multi-usable language. Websites can be programmed or entered into the world of data, artificial intelligence, and even games and robots. Virtually everything can be done through Python.
It is characterized by its ease and simplicity in writing and reading code, it uses the OOP method, which is an abbreviation of the word Object Oriented Programming, and it is scalable, and is widely used in many areas, so it can program small projects and even large projects, and programmers are advised Beginners can learn it.
It was created by Guido Van Rossum in 1986 while working at the Centrum Wiskunde & Informatica Research Center and has been in development since 1991 to the present day.
Features of Python language
- The popularity of Python is very high compared to other languages and there are many references available to learn it.
- It is a simple language to learn.
- Any program programmed in the Python language works on all systems in the world, and this is also a motivation to learn it.
- A language in great demand in the labor market, even in the areas of protection and information security.
- Both information security experts and novices are interested in penetration testing.
Work environment preparation Python
First, we enter the official website of Python to download it by choosing the downloads tab by clicking on the type of operating system and the version number as in this picture.
We are waiting for Python to be downloaded and installed, and to start a new project in Python we open a text document in Notepad and leave it blank and save it empty and put the document name extension .py for example, put the name app.py and then press the right mouse button on this folder and choose Edit with idle for slot.
This is for Windows users, as for users of Linux systems, it is essential with the system present, and to verify this, we write the following command in the terminal
sudo apt-get install python
And even phone users in the Termex application can install it with the following commands
pkg install python pkg install python2 pkg install python3
And to open the python editor in Linux or Termux, just type the word python3 in the terminal as in the figure.
In this way, we have prepared everything in Python and it remains to write the code and start with it.
Write your first program in Python
We will use the first command in it, which is the print command, as in the following figure we will print the word programmer tech.
When we run this code, it will print the word programmer tech.
As we noticed, we wrote the print command, followed by two quotes with the sentence to be printed, and then we executed the code by pressing Enter and printing this sentence for us in Linux and in Windows we save the file and press F5 to execute the code.