Python Operators || operators in python, python operators in hindi

Home ๐Ÿ‘‰ O level ๐Ÿ‘‰ Python ๐Ÿ‘‰ Unit 4


 Python Operators

เคเค• เค‘เคชเคฐेเคŸเคฐ เคเค• เคช्เคฐเคคीเค• (เคฏा เคšिเคจ्เคน) เคนै เคœो เคเค• เค‘เคชเคฐेเคถเคจ (เคฏा เค•ाเคฐ्เคฏ) เค•เคฐเคคा เคนै।

An operator is a symbol (or sign) that performs an operation (or action).

    เคฏเคฆि เค•ोเคˆ เค‘เคชเคฐेเคŸเคฐ เคเค•เคฒ เค‘เคฌ्เคœेเค•्เคŸ เคฏा เคฎाเคจ เคชเคฐ เค•ाเคฐ्เคฏ เค•เคฐเคคा เคนै, เคคो เค‰เคธे เคฏूเคจเคฐी (unary) เค‘เคชเคฐेเคŸเคฐ เค•เคนा เคœाเคคा เคนै। เคฏเคฆि เค•ोเคˆ เค‘เคชเคฐेเคŸเคฐ เคฆो เค‘เคฌ्เคœेเค•्เคŸ เคฏा เคฎाเคจों เคชเคฐ เค•ाเคฐ्เคฏ เค•เคฐเคคा เคนै, เคคो เค‰เคธे เคฌाเค‡เคจเคฐी (binary) เค‘เคชเคฐेเคŸเคฐ เค•เคนเคคे เคนैं। เคฏเคฆि เค•ोเคˆ เค‘เคชเคฐेเคŸเคฐ เคคीเคจ เค‘เคฌ्เคœेเค•्เคŸ เคฏा เคฎाเคจों เคชเคฐ เค•ाเคฐ्เคฏ เค•เคฐเคคा เคนै, เคคो เค‰เคธे เคŸเคฐเคจเคฐी (ternary) เค‘เคชเคฐेเคŸเคฐ เค•เคนเคคे เคนैं।

    If an operator operates on a single object or value, it is called a unary operator. If an operator operates on two objects or values, it is called a binary operator. If an operator operates on three objects or values, it is called a ternary operator.

 Types

  • Arithmetic Operators
  • Comparison (Relational) Operators
  • Boolean (Logical) Operators
  • Bitwise Operators
  • Assignment Operators
  • Membership Operators
  • Identity Operators

 Arithmetic Operators:-

   เค‡เคจ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคธाเคฎाเคจ्เคฏ เค…ंเค•เค—เคฃिเคคीเคฏ เค—เคฃเคจाเคं เคœैเคธे เคœोเคก़, เค—ुเคฃा เค†เคฆि เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เค…ंเค•เค—เคฃिเคค เค“เคชेเคฐเคŸเคฐ เคตे เคšिเคจ्เคน เคนैं เคœिเคจเค•ा เค‰เคชเคฏोเค— เค—เคฃिเคค เค”เคฐ เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฎें เคธंเค–्เคฏाเค“ं เคฏा เคตेเคฐिเคเคฌเคฒ्เคธ เคชเคฐ เคฌेเคธिเค• เค—เคฃिเคคीเคฏ เค•ाเคฐ्เคฏ เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เค•ंเคช्เคฏूเคŸเคฐ เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฎें, เค‡เคจ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคธंเค–्เคฏाเคค्เคฎเค• เคฎाเคจों เคฎें เคฌเคฆเคฒाเคต เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เคฏे เค‘เคชเคฐेเคŸเคฐ เค—เคฃिเคคीเคฏ เค—เคฃเคจा เค•เคฐเคจे เคฎें เคฎौเคฒिเค• เคนैं เค”เคฐ เคชाเคฏเคฅเคจ, เคธी, เคœाเคตा เค”เคฐ เค…เคจ्เคฏ เคช्เคฐोเค—्เคฐाเคฎिंเค— เคญाเคทाเค“ं เคฎें เคต्เคฏाเคชเค• เคฐूเคช เคธे เค‰เคชเคฏोเค— เค•िเค เคœाเคคे เคนैं।

    These operators are used to perform common arithmetic calculations like addition, multiplication etc. Arithmetic operators are symbols or characters used in mathematics and programming to perform basic mathematical operations on numbers or variables. In computer programming, these operators are used to manipulate numeric values. These operators are fundamental in performing mathematical calculations and are widely used in programming languages like Python, C, Java, and more.


  • Exponentiation ( ** )
  • Multiplication ( * )
  • Division ( / )
  • Floor (Integer) Division ( // )
  • Modulus ( % )
  • Addition ( + )
  • Subtraction ( - )

 Arithmetic operators in detail


Comparison Operators:-

     เคฏे เคฌाเค‡เคจเคฐी เค‘เคชเคฐेเคŸเคฐ्เคธ เคนैं เคœो เคฆो เคฎाเคจों เค•ी เคคुเคฒเคจा เค•เคฐเคคे เคนैं เค”เคฐ True เคฏा False เคฎें เคชเคฐिเคฃाเคฎ เคฆेเคคे เคนैं। เคคुเคฒเคจा เค‘เคชเคฐेเคŸเคฐ, เคœिเคจ्เคนें เคฐिเคฒेเคถเคจเคฒ เค‘เคชเคฐेเคŸเคฐ เค•े เคฐूเคช เคฎें เคญी เคœाเคจा เคœाเคคा เคนै, เค•ा เค‰เคชเคฏोเค— เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฎें เคฆो เคฎाเคจों เค•ी เคคुเคฒเคจा เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เคตे เคคुเคฒเคจा เค•े เค†เคงाเคฐ เคชเคฐ เคเค• เคฌूเคฒिเคฏเคจ เคชเคฐिเคฃाเคฎ (เคฏा เคคो 'เคธเคนी' เคฏा 'เค—เคฒเคค') เคฒौเคŸाเคคे เคนैं। เค‡เคจ เคคुเคฒเคจा เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เค…เค•्เคธเคฐ เคธเคถเคฐ्เคค เคฌเคฏाเคจों, เคฒूเคชों เค”เคฐ เค…เคจ्เคฏ เคจिเคฏंเคค्เคฐเคฃ เคธंเคฐเคšเคจाเค“ं เคฎें เคจिเคฐ्เคฃเคฏ เคฒेเคจे เค”เคฐ เคฎूเคฒ्เคฏों เคฏा เคตेเคฐिเคเคฌเคฒ्เคธ เค•े เคฌीเคš เคธंเคฌंเคงों เค•े เค†เคงाเคฐ เคชเคฐ เคช्เคฐोเค—्เคฐाเคฎ เค•े เคช्เคฐเคตाเคน เค•ो เคจिเคฏंเคค्เคฐिเคค เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै।

    These are binary operators that compare two values and result in True or False. Comparison operators, also known as relational operators, are used in programming to compare two values or expressions. They return a Boolean result (either `True` or `False`) based on the comparison. These comparison operators are often used in conditional statements, loops, and other control structures to make decisions and control the flow of a program based on the relationships between values or variables.

  • Less Than ( < )
  • Less Than or Equals To ( <= )
  • Greater Than ( > )
  • Greater Than or Equals To ( >= )
  • Equals To ( == )
  • Not Equals To ( != )

Comparison Operators in detail


Boolean (Logical) Operators:-

    เค‡เคจ เค‘เคชเคฐेเคŸเคฐ्เคธ เค•ा เค‰เคชเคฏोเค— เค•เคฎ्เคชाเค‰ंเคก เค•ंเคกीเคถเคจ्เคธ (เคเค• เคถเคฐ्เคค เคœो เคฆो เคฏा เค…เคงिเค• เคถเคฐ्เคคों เค•ो เคฎिเคฒाเค•เคฐ เคฌเคจा เคนो) เค•ो เคฌเคจाเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เคœเคฌ เคฌूเคฒिเคฏเคจ เค‘เคชเคฐेเคŸเคฐ्เคธ เคฌूเคฒ เคŸाเค‡เคช เค•े เคฎाเคจ เคœैเคธे True เคฏा False เคชเคฐ เค‘เคชเคฐेเคถเคจ เค•เคฐเคคे เคนैं เคคो เคฌूเคฒ เคŸाเค‡เคช เค•ा เคฐिเคœเคฒ्เคŸ เคฆेเคคे เคนैं। เคชाเคฏเคฅเคจ เคฎें เคฌूเคฒिเคฏเคจ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคฌूเคฒिเคฏเคจ เคฎाเคจों (เคธเคนी เค”เคฐ เค—เคฒเคค) เคชเคฐ เคคाเคฐ्เค•िเค• เค•्เคฐिเคฏाเคं เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें เคคीเคจ เคฎुเค–्เคฏ เคฌूเคฒिเคฏเคจ เค‘เคชเคฐेเคŸเคฐ เคนैं: `เค”เคฐ`, `เคฏा`, เค”เคฐ `เคจเคนीं`। เค‡เคจ เคฌूเคฒिเคฏเคจ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เค…เค•्เคธเคฐ เคธเคถเคฐ्เคค เคฌเคฏाเคจों, เคฒूเคชों เค”เคฐ เค…เคจ्เคฏ เคธ्เคฅिเคคिเคฏों เคฎें เค•िเคฏा เคœाเคคा เคนै เคœเคนां เค†เคชเค•ो เค•ुเค› เคถเคฐ्เคคों เค•ी เคธเคš्เคšाเคˆ เคฏा เคूเค  เค•े เค†เคงाเคฐ เคชเคฐ เคจिเคฐ्เคฃเคฏ เคฒेเคจे เค•ी เค†เคตเคถ्เคฏเค•เคคा เคนोเคคी เคนै। เคตे เค†เคชเค•े เคชाเคฏเคฅเคจ เคช्เคฐोเค—्เคฐाเคฎो เคฎें เค…เคงिเค• เคœเคŸिเคฒ เค”เคฐ เคธाเคฐ्เคฅเค• เคคเคฐ्เค• เคฌเคจाเคจे เคฎें เค†เคชเค•ी เคธเคนाเคฏเคคा เค•เคฐเคคे เคนैं।

    These operators are used to create compound conditions (a condition made up of two or more conditions). Boolean operators return a result of bool type when they operate on values of bool type, such as True or False. Boolean operators in Python are used to perform logical operations on boolean values (True and False). Python has three main boolean operators: `and`, `or`, and `not`. These boolean operators are often used in conditional statements, loops, and other situations where you need to make decisions based on the truth or falsity of certain conditions. They help you create more complex and meaningful logic in your Python programs.

  • Logical And ( and )
  • Logical Or ( or )
  • Logical Not ( not )

Boolean Operators in detail


Bitwise Operators:-

    เคฏे เค‘เคชเคฐेเคŸเคฐ्เคธ เคฌिเคŸ्เคธ เคชเคฐ เค‘เคชเคฐेเคถเคจ เค•เคฐเคคे เคนैं।  เคฎाเคจों เค•ो เคชเคนเคฒे เคฌाเค‡เคจเคฐी เคฎें เคฌเคฆเคฒा เคœाเคคा เคนै เคซिเคฐ เค•ैเคฒเค•ुเคฒेเคถเคจ เค•िเคฏा เคœाเคคा เคนै। เคฏे เค‘เคชเคฐेเคŸเคฐ्เคธ เค•ेเคตเคฒ เค‡เคจ्เคŸिเคœเคฐ เคฎाเคจों เคชเคฐ เค•ाเคฐ्เคฏ เค•เคฐเคคे เคนैं। เคชाเคฏเคฅเคจ เคฎें เคฌिเคŸเคตाเค‡เคœ़ เค‘เคชเคฐेเคŸเคฐ เค†เคชเค•ो เคชूเคฐ्เคฃांเค• เคฎाเคจों เค•े เคฌिเคŸ्เคธ เคฎें เคนेเคฐเคซेเคฐ เค•เคฐเคจे เค•ी เค…เคจुเคฎเคคि เคฆेเคคे เคนैं। เค‡เคจ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เค…เค•्เคธเคฐ เคจिเคฎ्เคจ-เคธ्เคคเคฐीเคฏ เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฎें เค•िเคฏा เคœाเคคा เคนै เค”เคฐ เคฌाเค‡เคจเคฐी เคกेเคŸा เค•े เคธाเคฅ เค•ाเคฎ เค•เคฐเคคे เคธเคฎเคฏ เคฏा เคฌिเคŸ-เคธ्เคคเคฐीเคฏ เคธंเคšाเคฒเคจ เค•ो เคถाเคฎिเคฒ เค•เคฐเคจे เคตाเคฒे เค•ुเค› เค…เคฒ्เค—ोเคฐिเคฅเคฎ เค•ो เคฒाเค—ू เค•เคฐเคคे เคธเคฎเคฏ เคตिเคถेเคท เคฐूเคช เคธे เค‰เคชเคฏोเค—ी เคนोเคคे เคนैं। เคฌिเคŸเคตाเค‡เคœ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคคเคฌ เค•िเคฏा เคœाเคคा เคนै เคœเคฌ เค†เคชเค•ो เคกेเคŸा เค•े เคฌाเค‡เคจเคฐी เคช्เคฐเคคिเคจिเคงिเคค्เคต เค•े เคธाเคฅ เค•ाเคฎ เค•เคฐเคจे เค•ी เค†เคตเคถ्เคฏเค•เคคा เคนोเคคी เคนै เคฏा เคœเคฌ เค†เคช เคจिเคฎ्เคจ-เคธ्เคคเคฐीเคฏ เคฌिเคŸ เคนेเคฐเคซेเคฐ เค•เคฐเคจा เคšाเคนเคคे เคนैं। เคตे เค…เค•्เคธเคฐ เค•ंเคช्เคฏूเคŸเคฐ เคนाเคฐ्เคกเคตेเคฏเคฐ, เคกेเคŸा เค•เคฎ्เคช्เคฐेเคถเคจ, เคเคจ्เค•्เคฐिเคช्เคถเคจ เค”เคฐ เคฌเคนुเคค เค•ुเค› เคธे เคธंเคฌंเคงिเคค เค…เคจुเคช्เคฐเคฏोเค—ों เคฎें เคฆेเค–े เคœाเคคे เคนैं।

    These operators operate on bits. The values are first converted to binary then the calculations are done. These operators work only on integer values. Bitwise operators in Python allow you to manipulate individual bits of integer values. These operators are often used in low-level programming and are particularly useful when working with binary data or implementing certain algorithms that involve bit-level operations. Bitwise operators are used when you need to work with the binary representation of data or when you want to perform low-level bit manipulation. They are often seen in applications related to computer hardware, data compression, encryption, and more.

  • Bitwise AND ( & )
  • Bitwise OR ( | )
  • Bitwise XOR ( ^ )
  • Bitwise NOT ( ~ )
  • Bitwise Left Shift ( << )
  • Bitwise Right Shift ( >> )


Assignment Operator ( = ):-

    เคฏเคน เค‘เคชเคฐेเคŸเคฐ เคฆाเคं เคธाเค‡เคก เค•े เคฎाเคจ เค•ो เคฌाเคं เคธाเค‡เคก เค•े เคตेเคฐिเคเคฌเคฒ เคฎें เคธ्เคŸोเคฐ เค•เคฐเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें เค…เคธाเค‡เคจเคฎेंเคŸ เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคตेเคฐिเคเคฌเคฒ्เคธ เคฎें เคฎाเคจ เคฐเค–เคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै। เคตे เค•िเคธी เคฎाเคจ เค•े เค…เคธाเค‡เคจเคฎेंเคŸ เค•ो เค—เคฃिเคคीเคฏ เค‘เคชเคฐेเคถเคจ เคฏा เค…เคจ्เคฏ เค‘เคชเคฐेเคถเคจ เค•े เคธाเคฅ เคœोเคก़เคคे เคนैं। เคฏे เค…เคธाเค‡เคจเคฎेंเคŸ เค‘เคชเคฐेเคŸเคฐ เคเค• เคนी เคšเคฐเคฃ เคฎें เค‘เคชเคฐेเคถเคจ เค•เคฐเคคे เคธเคฎเคฏ เคตेเคฐिเคเคฌเคฒ्เคธ เค•ो เค‰เคจเค•े เคตเคฐ्เคคเคฎाเคจ เคฎूเคฒ्เคฏों เค•े เค†เคงाเคฐ เคชเคฐ เค…เคชเคกेเคŸ เค•เคฐเคจे เค•ा เคเค• เคธंเค•्เคทिเคช्เคค เคคเคฐीเค•ा เคช्เคฐเคฆाเคจ เค•เคฐเคคे เคนैं।

    This operator stores the value of the right side in the variable on the left side. Assignment operators in Python are used to assign values to variables. They combine the assignment of a value with a mathematical operation or other operations. These assignment operators provide a concise way to update variables based on their current values while performing an operation in a single step.

syntax: variable = value

example: x = 5

hint: stores value 5 in variable x

 

Membership Operators:-

    เคฏे เค‘เคชเคฐेเคŸเคฐ्เคธ เค•िเคธी เคฎाเคจ เค•ो เค•िเคธी เคฎाเคจों เค•े เคธเคฎूเคน เคœैเคธे string เคฏा list เคฎें   เค–ोเคœเคคे เคนैं เค”เคฐ เคฎाเคจ เค•े เคฎिเคฒเคจे เคฏा เคจ เคฎिเคฒเคจे เคชเคฐ True เคฏा False เคฎें เคชเคฐिเคฃाเคฎ เคฆेเคคे เคนैं। เคชाเคฏเคฅเคจ เคฎें เคฎेเคฎ्เคฌเคฐเคถिเคช เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคฏเคน เคชเคฐीเค•्เคทเคฃ เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เค•ोเคˆ เคฎाเคจ เคฏा เคเคฒिเคฎेंเคŸ เค•िเคธी เค—्เคฐुเคช (เคธीเค•्เคตेंเคธ) เค•ा เคธเคฆเคธ्เคฏ เคนै, เคœैเคธे เคธ्เคŸ्เคฐिंเค—, เคธूเคšी เคฏा เคŸเคชเคฒ। เคฎेเคฎ्เคฌเคฐเคถिเคช เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เค…เค•्เคธเคฐ เคธเคถเคฐ्เคค เคฌเคฏाเคจों เค”เคฐ เคฒूเคชों เคฎें เค•िเคฏा เคœाเคคा เคนै เคคाเค•ि เคฏเคน เคœांเคšा เคœा เคธเค•े เค•ि เค•ोเคˆ เคเคฒिเคฎेंเคŸ เค‰เคธ เคธ्เคฅिเคคि เค•े เค†เคงाเคฐ เคชเคฐ เคตिเคถिเคท्เคŸ เค•ाเคฐ्เคฐเคตाเคˆ เค•เคฐเคจे เคธे เคชเคนเคฒे เค—्เคฐुเคช (เคธीเค•्เคตेंเคธ) เคฎें เคฎौเคœूเคฆ เคนै เคฏा เคจเคนीं।

    These operators search for a value in a set of values such as a string or list and return True or False if the value is found or not found. Membership operators in Python are used to test whether a value or element is a member of a sequence, such as a string, list, or tuple. Membership operators are often used in conditional statements and loops to check if an element is present in a collection before taking specific actions based on that condition.

  • In Membership ( in )

  • Not In Membership ( not in )


Identity Operators:-

    เคฏे เค‘เคชเคฐेเคŸเคฐ्เคธ เค‘เคฌ्เคœेเค•्เคŸ्เคธ เค•ी เค†เค‡เคกेंเคŸिเคŸी (เคฎेเคฎोเคฐी เคเคก्เคฐेเคธ) เค•ो เคšेเค• เค•เคฐเคคे เคนैं เค”เคฐ เคธเคฎाเคจ เคนोเคจे เคฏा เคจ เคนोเคจे เค•े เค†เคงाเคฐ เคชเคฐ True เคฏा False เคฎें เคชเคฐिเคฃाเคฎ เคฆेเคคे เคนैं। เคชाเคฏเคฅเคจ เคฎें, เค†เค‡เคกेंเคŸिเคŸी เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เคฏเคน เคจिเคฐ्เคงाเคฐिเคค เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เค•्เคฏा เคฆो เคตेเคฐिเคเคฌเคฒ เคฏा เค‘เคฌ्เคœेเค•्เคŸ เคเค• เคนी เคฎेเคฎोเคฐी เคธ्เคฅाเคจ เค•ो เคธंเคฆเคฐ्เคญिเคค (เคฆเคฐ्เคถाเคคे) เค•เคฐเคคे เคนैं เคฏा เคเค• เคนी เคชเคนเคšाเคจ เคฐเค–เคคे เคนैं। เค†เค‡เคกेंเคŸिเคŸी เค‘เคชเคฐेเคŸเคฐों เค•ा เค‰เคชเคฏोเค— เค…เค•्เคธเคฐ เค‘เคฌ्เคœेเค•्เคŸ เค•ी เคคुเคฒเคจा เค•เคฐเคจे เค”เคฐ เคฏเคน เคœांเคšเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เค•्เคฏा เคตे เคเค• เคนी เค‰เคฆाเคนเคฐเคฃ เคนैं, เค–ाเคธเค•เคฐ เคœเคฌ เคฒिเคธ्เคŸ, เคกिเค•्เคถเคจเคฐी เค”เคฐ เคฏूเคœเคฐ-เคกिเคซाเค‡ंเคก เค•्เคฒाเคธेเคœ เคœैเคธी เคชเคฐिเคตเคฐ्เคคเคจเคถीเคฒ เค‘เคฌ्เคœेเค•्เคŸ เคธे เคจिเคชเคŸเคคे เคนैं। เคง्เคฏाเคจ เคฐเค–ें เค•ि เคฏे เค‘เคชเคฐेเคŸเคฐ เคชเคนเคšाเคจ เค•ी เคœाँเคš เค•เคฐเคคे เคนैं, เคธเคฎाเคจเคคा เค•ी เคจเคนीं। เคฆो เค‘เคฌ्เคœेเค•्เคŸ เคฎूเคฒ्เคฏ เคฎें เคธเคฎाเคจ เคนो เคธเค•เคคी เคนैं เคฒेเค•िเคจ เค‰เคจเค•ी เคชเคนเคšाเคจ เคธเคฎाเคจ เคจเคนीं เคนो เคธเค•เคคी।

    These operators check the identity (memory address) of the objects and return True or False depending on whether they are equal or not. In Python, identity operators are used to determine if two variables or objects reference the same memory location or have the same identity. Identity operators are often used to compare objects and check if they are the same instance, especially when dealing with mutable objects like lists, dictionaries, and user-defined classes. Keep in mind that these operators check for identity, not equality. Two objects can be equal in value but not have the same identity.

  • Is Identitical ( is )

  • Is Not Identitical ( is not )




---END---

Comments