Are you starting to program and are you looking for a simple and clear manual? Are you curious about Python? This Python Beginner's Guide is what you've been looking for.

Python for Beginners: What is Python?

Python is a programming language created by Guido Van Rossum in 1991.
Considered a simple language, beautiful to read and to see, suitable for beginners, today Python is used in many sectors:

web development with Django and Flask

data science

machine learning and computer vision

scripting

database

data mining

Today Python has reached version 3.8 and according to the latest data, it is the programming language that is growing fastest in the world (1).
Python for beginners: Python is interpreted and of a high standard
Time to start our exploration! First of all, Python is an interpreted language.
Interpreted means that the Python code you write is read on the fly by a "translator" who transforms it into "machine" language, which is a language that can only be understood by your computer's processor.

From now on I will refer to the "translator" as to the Python engine, the tool that reads and interprets our code. The transition from code to execution is therefore almost immediate and you don't have to worry about low-level details like memory or instructions for the processor.
In addition to the interpreted programming languages, ​​there are also compiled ones, where the code you write speaks more directly to the machine and must be translated by a tool called a compiler.
The compiler then produces your own program, called binary, which you can run on the computer. The transition from code to execution here is slightly more cumbersome. Compiled languages ​​are also more difficult to master than those interpreted because they speak to the machine closely.
On the other hand, languages ​​interpreted as Python can be written in a "language" very similar to English, and for this reason, Python is said to be of high level.
Another example of a high-level interpreted language is JavaScript. Python for Beginners: Python is dynamic In addition to being interpreted and high level, Python is also a dynamic language.
In dynamic programming, it means that if we have a variable (think of the variable as a box) that contains a cat, later in the code we can exchange the cat with a human.
The container is a cat first, then it becomes a human, and the program does not make a turn. Types are said to be dynamic.

for a course Python training in Bangladesh

Python also allows this and leaves a lot of freedom for the developer.
The opposite of a dynamic language is a static language, where if a variable (the container) contains a type of cat, later on, it is not possible to remove the cat and put a human in it :

The difference between static and dynamic languages ​​is that the former is more rigid than the latter, and in some ways safer, especially for "critical" applications such as financial ones.
For some years now, Python can also be transformed into a static language with the so-called type annotations (advanced concept, but if you have time and want to watch this video of mine ).

Python for Beginners: Python is object-oriented
In any tutorial, Python is referred to as object-oriented language.
Ok, but what are these objects? What a programmer does is take concepts from the real world like ship, house, person, car, tree, and carry them into the code.
When we take an entity as a "tree" and fix it in Python code as a Tree, we are simply creating a new object. Python is said to be object-oriented because it is very easy to create new objects and reason about them in a very comfortable way.

Later you will understand better what it is.
Python for Beginners: Python is style-conscious
One of the most important features of Python is the focus on a style .
By style I don't just mean beautiful or ugly code, but also how it is interpreted by the Python engine (remember, the Python engine is the tool that reads and interprets the code).

Let's take a practical example, with your first line of Python code. Look at this instruction:
You can see how it is moved four spaces to the right (one tab stroke). If I run this Python code I will have an error (also called an exception): IndentationError.

What does it mean? In Python it is important not only to write "nice" code but also to respect the so-called indentation, which is the tabulation of the code.
In fact, the Python engine reads the code based on how it is indented. The example above will not turn, but respecting the tabulation, like this:

print("Hello Python!")

you will see "Hello Python!" printed somewhere (soon you'll find out where).
Python for Beginners: How Do I Run Python?
Disclaimer: before continuing read here if you don't know what a terminal is.
To use Python you need to download and install it on your computer.

Python is already installed on some operating systems such as Linux (Fedora, Ubuntu), while for MacOs and Windows you have to download and install it by hand. I refer you here for download, in this section I want to quickly explain how to run Python code.

After installing Python (be sure to install version 3.x) you should have the python3 executable on the system. There are two ways to use Python on your computer. The first option is to create files with Python code and a .py extension, and then launch them with the executable Python.
Example, to print a simple message on the terminal, create a file called hello.py with the following code:


When creating Python files I suggest you call the file with a descriptive name, which does not contain spaces. Example hello.py is fine, but "my python file that's nice.py" no. Print ("Hello Python!"). Py isn't good either. Second option to run Python code: the Python console. After installing Python, open a terminal and run the python3 executable:

python3

You will find yourself in the Python console (you should see the symbol >>>) where you can directly launch small instructions and write code for quick tests:

>>> print("Hello Python!")

In the examples below, you will find both Python files and instructions launched directly in the console. Python for beginners: basic data types

We finally begin our exploration of Python, starting from the "data types".
When we talk about types of data in programming we refer to the fundamental blocks on which everything else is built.

But to be more precise, "the type" is a bit like what for life on earth is the species. For example, we are Homo sapiens, while wolves are of the Canis lupus species.