Basic Operators in Python:

Arithmetic Operators:  We use arithmetic operators to perform arithmetic operations like addition, subtraction, multiplication, and division in python for data science.

operators in python

code of python for data science

  1. Relational Operators:

    We use relational operators to compare the values in a an equation. The output from relational operator is either True or False.

relational operators in python

  1. Logical Operators:

    These operators perform the logical function AND and OR.

code for python in data science

  1. Bitwise Operators:

    These operators act on bits and carries out bit by bit operation.

  1. Assignment Operators:

    Assignment operators are there to assign values to variables.

python for data science

  1. Special Operators: Apart from the above operators, there are certain special operators.
  • Identity Operators: Identity operators are is and is not. They are there to find out whether two values are on the same part of memory. However, equality amongst two variables does not imply they are identical.

We will get TRUE if the operands are identical and is is in use. Also, we will get FALSE if the operands are identical and are not is in use.

python for data science

  • Membership Operators:

    We use this to find whether a value or variable is in a sequence or not. In and not in belongs to the membership operators.

It will be TRUE if the value is found in the sequence and in is in use. However, it will be TRUE if the value is not present in the sequence and not in is in use.

So, to learn more about operators and expression in python for data science, you can check this and this. Also, you can check this to install the software to start working.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.