Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Stackorigin – The Community of Question and Answers

Stackorigin – The Community of Question and Answers Logo Stackorigin – The Community of Question and Answers Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question

Python Operator’s

Operator is nothing but perform the operation on operands.

There are several operators are there those are:

  • Arithmetic operator
  • Relational operator
  • Logical operator
  • Assignment operator
  • Special operator
  • Concatenation Operator
  • Replication Operator
  • Ternary Operator
  • Special Operator

Arithmetic operator:

AdditionSubtraction
MultiplicationDivision and Floor Division
Modulo DivisionExponent
  1. Addition Operator: Addition operator denoted by “+”
  2. Subtraction Operator: Subtraction Operator denoted by “-”
  3. Multiplication Operator: Multiplication operator denoted by “*”
  4. Division Operator: Division operator denoted by “/”
    • NOTE: Division operator give in float value’s.
  5. Modulo Operator: Modulo operator denoted by “%”
  6. Floor Division Operator: Floor division operator denotes by “//”
    • Note: It will generate int or float depends on value’s.
  7. Exponent Operator: Exponent operator denotes by “**”

Relational operator: Relational operator also know as comparison operator.

>>=<
<===!=
  1. Less Than Operator: Less than operator denotes by “<“
  2. Less Than equal to Operator: Less than equal to operator denotes by “<=”
  3. Greater Than Operator: Greater than operator denotes by “>”
  4. Greater Than equal to Operator: Greater than equal to operator denotes by “>=”
  5. Equality Operator: equality operator denotes by “==”
  6. Not Equality Operator: Not equality operator denotes by “!=”

Logical Operator: Logical operator contains three operator’s. those are

  • Logical And Operator
  • Logical OR Operator
  • Logical NOT Operator
  1. Logical And Operator: Returns true if both statements are true
    • True and True = True
  2. Logical OR Operator: Returns true if one of the statements is true.
    • True or False = True
  3. Logical NOT Operator: Reverse the result, returns false if the result is true.
    • not True = False

Assignment Operator: Assignment operators are used to assign values to variables.

Concatenation Operator:

  • “stackorigin” + 3 => can only concatenate str (not int) to str
  • If we want apply “+” operator for string compalosory both arguments should be string only
    • “stackorigin”+”tutorials” => “stackorigintutorials”

Replication Operator:

  • If we want apply “*” operator compulsory one arguments should be string and another one is int.
    • “Stackorigin” * 2 = StackoriginStackorigin

Ternary Operator: If condition true firstvalue will get or else secondvalue

  • Syntax: firstvalue if condition else secondvalue
    • example: x = 30 if 10<20 else 40

Special Operator: It contain two operator’s.

  1. Identity Operator
  2. Membership Operator

Identity Operator

Membership Operator:

Share
  • Facebook

Sidebar

Ask A Question

Adv 120x600

Looking for advertising?

Consider These Things If You Appreciate What stackorigin Does: Stackorigin is a community where you can ask questions and find answers, for free to everyone. We would appreciate it if you bought us a coffee if you liked what we were doing.

Buy me a Coffe

Adv 120x600

  • Random
  • Answers
    • On: May 12, 2021
    • Answer: 1

    Do bloggers really make money?

    • On: June 15, 2022
    • Answer: 1

    what is array in python

    • On: August 5, 2022
    • Answers: 0

    Order Motinorm - The pharmacy that really delivers, Domperidone oral ...

    • On: August 3, 2022
    • Answers: 0

    Where To Purchase Buspar France ?, Order buspar on the

    • On: August 6, 2022
    • Answers: 0

    Do you want to buy Sinemet online ?, Buy sinemet ...

  • sam
    sam added an answer Please go launch below link   https://digitalcloud.training/aws-sysops-administrator-associate-free-practice-exam-questions/ August 3, 2023 at 9:55 am
  • newoc
    newoc added an answer Absolutely! You can confidently utilize authentic and up-to-date Dumps that… July 22, 2023 at 7:31 am
  • strapcart_online
    strapcart_online added an answer Impotence is commonly seen in men between the ages of… July 21, 2023 at 8:26 am
  • lasop
    lasop added an answer If you're looking for the ultimate resource to excel in… July 19, 2023 at 5:00 am
  • bruceparker
    bruceparker added an answer Buy Dapoxetine Online is a medication primarily used for the… July 17, 2023 at 7:34 am

Adv 120x600

Trending Categories

Health
2050Questions
, 4Followers
Programming
1296Questions
, 0Followers
Technology
218Questions
, 3Followers
General Knowledge
131Questions
, 0Followers
Business & Finance
86Questions
, 4Followers

Adv 120×600

Stats

  • Questions 4k
  • Answers 1k
  • Best Answers 105
  • Users 163

Users

Aluminium Die Casting Products Manufacturers

Aluminium Die Casting Products Manufacturers

  • 0 Questions
  • 0 Answers
irene1707

irene1707

  • 0 Questions
  • 0 Answers
Ductile Iron Casting Manufacturers

Ductile Iron Casting Manufacturers

  • 0 Questions
  • 0 Answers
Navratan

Navratan

  • 0 Questions
  • 0 Answers
AAC Blocks Manufacturers in Tamil Nadu

AAC Blocks Manufacturers in Tamil Nadu

  • 0 Questions
  • 0 Answers

Adv 120×600

Explore

  • Recent Questions
  • Most Answered
  • Answers
  • No Answers
  • Most Visited
  • Most Voted
  • Random
  • Polls

Footer

Stackorigin - The Community of Question and Answers

Stackorigin

Stackorigin is the world’s largest Q&A networking site, Stackorigin community brings you the collaboration of all the various Questions and the related Answers given by the community.

About

  • About Us
  • Contact Us
  • FAQ
  • Submit Guest Post Article on Technology, Education, Health, Apps, Gadgets, IoT, AI, Business, Digital Marketing and More

Info

  • Privacy Policy
  • Terms and Conditions
  • Community Guidelines
  • Tags

Products

  • Tutorials
  • Advertising
  • Categories
  • Corona
  • StackHow

Follow

© 2022 Stackorigin. All Rights Reserved.