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: September 18, 2021
    • Answers: 0

    How Much Time Does It Take to Learn Java?

    • On: July 25, 2022
    • Answers: 4

    How to trigger a phone call when clicking a link ...

    • On: August 7, 2022
    • Answers: 0

    buy Amoxicilina Rhode Island, Order amoxicilina in europe

    • On: October 3, 2020
    • Answer: 1

    How do I permanently delete my twitter?

    • On: August 8, 2022
    • Answers: 0

    Metacam purchase United States, Metacam dosage for

  • strapcart_online
    strapcart_online added an answer Sildenafil citrate is a common ingredient in Cenforce 150mg tablets. This drug… March 21, 2023 at 11:42 am
  • strapcart_online
    strapcart_online added an answer Vilitra 20mg tablets are used to overcome the problem of… March 18, 2023 at 6:13 am
  • ashok
    ashok added an answer Not every girl, there are some girls out there who… March 16, 2023 at 4:15 am
  • strapcart_online
    strapcart_online added an answer Tadarise 40 Tablet is used to permanently remove the problem… March 4, 2023 at 5:48 am
  • strapcart_online
    strapcart_online added an answer Men use Cenforce D tablets for the treatment of sexual… March 1, 2023 at 5:59 am

Adv 120x600

Trending Categories

Health
2041Questions
, 4Followers
Programming
1236Questions
, 0Followers
Technology
216Questions
, 3Followers
General Knowledge
131Questions
, 0Followers
Business & Finance
84Questions
, 4Followers

Adv 120×600

Stats

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

Users

niyadas823

niyadas823

  • 0 Questions
  • 0 Answers
nirala3

nirala3

  • 2 Questions
  • 0 Answers
Perrywalton

Perrywalton

  • 1 Question
  • 0 Answers
veeraa

veeraa

  • 0 Questions
  • 0 Answers
Stewesmitz

Stewesmitz

  • 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.