What are operators in Python

September 21, 2022

0
Tags: Technologies

python

 

When you want to create an application or website, the first thing you choose is the programming language. There are several that stand out as developer favorites, such as Java and C#, with Python on this list.

 

But what is Python? It is a programming language through which developers can create websites and software, automate, among other tasks. “It is built in a relatively intuitive way to write and understand, which makes it an ideal coding language for those looking for rapid development. It is what is known as a general purpose language”, because several different programs can be created, explains Computer Hoy.

 

What are operators in Python

 

One of the key features of Python that make it an attractive programming language for developers are the operators, we are going to explain a little about what they are and how they can be applied in the development process.

 

“In Python, operators are special symbols that indicate that some kind of calculation is to be performed. The values ​​on which an operator acts are called operands” they explain in the Real Python portal.

 

This, in simple words, means that an operator is a signal to the code that it must apply a mathematical operation in that line in order to continue with the project creation process. They look like this:

 

>>> to = 10
>>> b = 20
>>> a + b
30

 

In the example presented, + acts as an operator that adds the operands a and b together. An operand can either be a literal value or a variable that refers to an object. Another example:

 

>>> to = 10
>>> b = 20
>>> a + b - 5
25

 

Types of operators in Python

 

Arithmetic operators

 

+ (unary)
+ (binary)
- (unary)
- (binary)
*
/
%
//
**

 

Comparison operators

 

==
!=
<
<=
>
>=

 

Characteristics that define Python

 

On the Python website, they share these programming language features that are very useful for developers:

 

  • It incorporates modules, exceptions, dynamic types, very high-level dynamic data types, and classes.
  • It supports multiple programming paradigms beyond object-oriented programming, such as procedural and functional programming.
  • Python combines remarkable power with very clear syntax.
  • It has interfaces to many libraries and system calls, as well as several window systems, and is extensible in C or C++.
  • It can also be used as an extension language for applications that need a programmable interface.
  • Python is portable: it runs on many Unix variants, including Linux and macOS, and on Windows.

 

We recommend you on video