Operators in Python

Operators in Python

In Python, operators are special symbols or keywords used to perform operations on variables and values. Here's an overview of the different types of operators in Python:

  1. Arithmetic Operators:Addition: +Subtraction: -Multiplication: *Division: /Floor Division: // (returns the quotient without the remainder)Modulus: % (returns the remainder after division)Exponentiation: **
  2. Assignment Operators:Assignment: =Addition Assignment: +=Subtraction Assignment: -=Multiplication Assignment: *=Division Assignment: /=Modulus Assignment: %=Exponentiation Assignment: **=Floor Division Assignment: //=
  3. Comparison Operators:Equal to: ==Not equal to: !=Greater than: >Less than: <Greater than or equal to: >=Less than or equal to: <=
  4. Logical Operators:Logical AND: andLogical OR: orLogical NOT: not
  5. Identity Operators:Identity (is): is (returns True if both variables point to the same object)Not Identity (is not): is not (returns True if both variables do not point to the same object)
  6. Membership Operators:Membership (in): in (returns True if a sequence contains a specified value)Not Membership (not in): not in (returns True if a sequence does not contain a specified value)
  7. Bitwise Operators:Bitwise AND: &Bitwise OR: |Bitwise XOR: ^Bitwise NOT: ~Left Shift: <<Right Shift: >>

These operators can be used in various combinations to perform different operations on variables and values in Python. Understanding how to use operators is essential for writing effective and concise Python code.


📥 Follow MD ZAHEDUL ISLAM for more!! 📥

🔰 Learning: https://www.udemy.com/course/sql-developer-with-ai/?referralCode=197E489E771B3F128048

🔰 Email: zahidsqldba07@gmail.com

🔰 Digital Bagdes: https://lnkd.in/gE-Hsd7X

🔰 Upwork Profile 👇 https://lnkd.in/gJ6Si-Mp

🔰 Fiverr Profile 👇 https://lnkd.in/g4CPb7SR!

🔰 People Per Hour Profile 👇 https://lnkd.in/gzarqX74

🔰 Freelancer Profile 👇 https://lnkd.in/gxP9S7ib

🔰 Whatsapp: +880 1704862663

To view or add a comment, sign in

More articles by 🏆Python 🐍Developer 🎖Data Scientist 🍀Data Analytics, BI, NLP, 🏵Machine Learning & AI🥇

Explore content categories