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

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


 Comparison Operators in Python

เคฏे เคฌाเค‡เคจเคฐी เค‘เคชเคฐेเคŸเคฐ्เคธ เคนैं เคœो เคฆो เคฎाเคจों เค•ी เคคुเคฒเคจा เค•เคฐเคคे เคนैं เค”เคฐ True เคฏा False เคฎें เคชเคฐिเคฃाเคฎ เคฆेเคคे เคนैं।

These are binary operators that compare two values and result in True or False.

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

Less Than (<):-

    เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•े เคฌाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคฏเคฆि เคฆाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคธे เค›ोเคŸी เคนै เคคो เคชเคฐिเคฃाเคฎ True เคฆेเคคा เคนै เค…เคจ्เคฏเคฅा False เคฆेเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें, "less than" เค‘เคชเคฐेเคŸเคฐ เค•ो เค•เคฎ-เคธे-เค•เคฎ เคšिเคน्เคจ (<) เคฆ्เคตाเคฐा เคฆเคฐ्เคถाเคฏा เคœाเคคा เคนै। เค‡เคธเค•ा เค‰เคชเคฏोเค— เคฆो เคฎाเคจों เค•ी เคคुเคฒเคจा เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค”เคฐ เคฏเคฆि เคฌाเคˆं เค“เคฐ เค•ा เคฎाเคจ เคฆाเคˆं เค“เคฐ เค•े เคฎाเคจ เคธे เค•เคฎ เคนै เคคो เคฏเคน 'True' เคฒौเคŸाเคคा เคนै। เคฏเคฆि เคถเคฐ्เคค เคชूเคฐी เคจเคนीं เคนोเคคी เคนै, เคคो เคฏเคน 'False' เคฒौเคŸाเคคा เคนै।

    Returns True if the value on the left side of this operator is less than the value on the right side, otherwise it returns False. In Python, the "less than" operator is denoted by the less-than sign (<). It is used to compare two values and returns `True` if the value on the left is less than the value on the right. If the condition is not met, it returns `False`.


syntax: x < y
example: 3 < 4
result: True

Less Than or Equals To (<=):-

    เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•े เคฌाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคฏเคฆि เคฆाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคธे เค›ोเคŸी เคฏा เคฌเคฐाเคฌเคฐ เคนै เคคो เคชเคฐिเคฃाเคฎ True เคฆेเคคा เคนै เค…เคจ्เคฏเคฅा False เคฆेเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें, "less than or equals to" เค‘เคชเคฐेเคŸเคฐ เค•ो `<=` เคฆ्เคตाเคฐा เคฆเคฐ्เคถाเคฏा เคœाเคคा เคนै। เค‡เคธเค•ा เค‰เคชเคฏोเค— เคฏเคน เคœांเคšเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เคฌाเคˆं เค“เคฐ เค•ा เคฎाเคจ เคฆाเคˆं เค“เคฐ เค•े เคฎाเคจ เคธे เค•เคฎ เคฏा เค‰เคธเค•े เคฌเคฐाเคฌเคฐ เคนै। เคฏเคฆि เคธ्เคฅिเคคि เคธเคค्เคฏ เคนै, เคคो เคฏเคน 'True' เคฒौเคŸाเคคी เคนै; เค…เคจ्เคฏเคฅा, เคฏเคน 'False' เคฒौเคŸाเคคा เคนै। เค†เคช เคฏเคน เคจिเคฐ्เคงाเคฐिเคค เค•เคฐเคจे เค•े เคฒिเค เคธंเค–्เคฏाเค“ं, เคšเคฐ เคฏा เคเค•्เคธเคช्เคฐेเคถंเคธ เค•ी เคคुเคฒเคจा เค•เคฐเคจे เค•े เคฒिเค `<=` เค‘เคชเคฐेเคŸเคฐ เค•ा เค‰เคชเคฏोเค— เค•เคฐ เคธเค•เคคे เคนैं เค•ि เคฌाเคฏां เค‘เคชเคฐेंเคก เคฆाเคं เค‘เคชเคฐेंเคก เคธे เค•เคฎ เคนै เคฏा เค‰เคธเค•े เคฌเคฐाเคฌเคฐ เคนै।

    Returns True if the value on the left side of this operator is less than or equal to the value on the right side, otherwise it returns False. In Python, the "less than or equal to" operator is represented by `<=`. It is used to check if the value on the left is less than or equal to the value on the right. If the condition is true, it returns `True`; otherwise, it returns `False`. You can use the `<=` operator to compare numbers, variables, or expressions to determine if the left operand is less than or equal to the right operand.


syntax: x <= y
example: 3 <= 4
result: True

Greater Than (>):-

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

    Returns True if the value on the left side of this operator is greater than the value on the right side, otherwise it returns False. In Python, the greater than operator is used to compare two values and determine if the left value is greater than the right value. The greater than operator is represented by the ">" symbol. It returns `True` if the left operand is greater than the right operand, and `False` otherwise. You can use the greater than operator to compare numbers, variables, or expressions to determine their relative magnitudes.


syntax: x > y
example: 3 > 4
result: False

Greater Than or Equals To (>=):-

    เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•े เคฌाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคฏเคฆि เคฆाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคธे เคฌเฅœी เคฏा เคฌเคฐाเคฌเคฐ เคนै เคคो เคชเคฐिเคฃाเคฎ True เคฆेเคคा เคนै เค…เคจ्เคฏเคฅा False เคฆेเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें, เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•ो `>=` เคฆ्เคตाเคฐा เคฆเคฐ्เคถाเคฏा เคœाเคคा เคนै। เค‡เคธเค•ा เค‰เคชเคฏोเค— เคฏเคน เคœांเคšเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เคฌाเคฏां เค‘เคชเคฐेंเคก เคฆाเคं เค‘เคชเคฐेंเคก เคธे เคฌเคก़ा เคนै เคฏा เค‰เคธเค•े เคฌเคฐाเคฌเคฐ เคนै। เคฏเคฆि เคธ्เคฅिเคคि เคธเคค्เคฏ เคนै, เคคो เคฏเคน 'True' เคฒौเคŸाเคคी เคนै; เค…เคจ्เคฏเคฅा, เคฏเคน 'False' เคฒौเคŸाเคคा เคนै।

    Returns True if the value on the left side of this operator is greater than or equal to the value on the right side, otherwise it returns False. In Python, the greater than or equals to operator is represented by `>=`. It is used to check if the left operand is greater than or equal to the right operand. If the condition is true, it returns `True`; otherwise, it returns `False`.


syntax: x >= y
example: 3 >= 4
result: False

Equals To (==):-

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

    Returns True if the value on the left side of this operator is equal to the value on the right side, otherwise it returns False. In Python, the "equals to" operator is used to compare two values for equality. It is represented by a double equals sign (`==`). It's important to note that the "equals to" operator (`==`) is used for comparisons, whereas a single equals sign (`=`) is used for assignment when you want to assign a value to a variable.


syntax: x == y
example: 3 == 4
result: False

Not Equals To (!=):-

    เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•े เคฌाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เคฏเคฆि เคฆाเคं เคธाเค‡เคก เค•ी เคตैเคฒ्เคฏू เค•े เคฌเคฐाเคฌเคฐ เคจเคนीं เคนै เคคो เคชเคฐिเคฃाเคฎ True เคฆेเคคा เคนै เค…เคจ्เคฏเคฅा False เคฆेเคคा เคนै। เคชाเคฏเคฅเคจ เคฎें, "not equals to" เค‘เคชเคฐेเคŸเคฐ เค•ो `!=` เคฆ्เคตाเคฐा เคฆเคฐ्เคถाเคฏा เคœाเคคा เคนै। เค‡เคธ เค‘เคชเคฐेเคŸเคฐ เค•ा เค‰เคชเคฏोเค— เคฏเคน เคคुเคฒเคจा เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै เค•ि เค•्เคฏा เคฆो เคฎाเคจ เคเค• เคฆूเคธเคฐे เค•े เคฌเคฐाเคฌเคฐ เคจเคนीं เคนैं। เคฏเคฆि เคฎाเคจ เคญिเคจ्เคจ เคนैं, เคคो `!=` เค•ा เคชเคฐिเคฃाเคฎ `True` เคฎिเคฒเคคा เคนै, เค”เคฐ เคฏเคฆि เคตे เคฌเคฐाเคฌเคฐ เคนैं, เคคो เคฏเคน `False` เค•ा เคฎूเคฒ्เคฏांเค•เคจ เค•เคฐเคคा เคนै।

    Returns True if the value on the left side of this operator is not equal to the value on the right side, otherwise it returns False. In Python, the "not equals to" operator is represented by `!=`. This operator is used to compare whether two values are not equal to each other. If the values are different, the expression using `!=` evaluates to `True`, and if they are equal, it evaluates to `False`.


syntax: x != y
example: 3 != 4
result: True






NEXT:-


---END---

Comments