Operators in Python in Hindi – पायथन ऑपरेटर क्या है?

Python में Operators वे symbols होते हैं जो किसी operation को perform करने के लिए इस्तेमाल किए जाते हैं। Operator का उपयोग operands पर अलग-अलग कार्य (operations) करने के लिए किया जाता है। उदाहरण के लिए:- जोड़, गुणा, भाग आदि।

Types of Python Operators in Hindi

Python में मुख्य रूप से सात प्रकार के operators होते हैं:

  1. Arithmetic Operators
  2. Comparison Operators
  3. Logical Operators
  4. Bitwise Operators
  5. Assignment Operators
  6. Identity Operators
  7. Membership Operators

चलिये, इन operators को विस्तार में समझते हैं।

1. Arithmetic Operators

Arithmetic operators का उपयोग गणितीय (Mathematical) कार्यों के लिए किया जाता है, जैसे- addition (जोड़), subtraction (घटाना), multiplication (गुणा), division (भाग) आदि। नीचे कुछ प्रमुख arithmetic operators हैं:

OperatorDescriptionExample
+Addition (जोड़)a + b
Subtraction (घटाव)a – b
*Multiplication (गुणा)a * b
/Division (भाग)a / b
%Modulus (शेष)a % b
**Exponentiation (घातांक)a ** b
//Floor Division (पूर्ण भाग)a // b

2. Comparison Operators

Comparison operators का उपयोग दो values को compare करने के लिए किया जाता है। यह true या false को return करता है।

OperatorDescriptionExample
==Equal to (बराबर)a == b
!=Not equal to (असमान)a != b
>Greater than (बड़ा)a > b
<Less than (छोटा)a < b
>=Greater than or equal to (बड़ा या बराबर)a >= b
<=Less than or equal to (छोटा या बराबर)a <= b

3. Logical Operators

Logical operators का उपयोग logical statements को जोड़ने के लिए किया जाता है। ये boolean values (True, False) को return करते हैं।

OperatorDescriptionExample
andयदि दोनों स्टेटमेंट true हों तो ही truea and b
orयदि कोई भी एक स्टेटमेंट true हो तो truea or b
notयह statement को reverse (उल्टा) करता है। not a

4. Bitwise Operators

Bitwise operators का उपयोग binary numbers पर operations करने के लिए किया जाता है। 

OperatorDescriptionExample
&ANDa & b
|ORa | b
^XORa ^ b
~NOT~a
<<Left Shifta << 1
>>Right Shifta >> 1

5. Assignment Operators

Assignment operators का उपयोग variables को values प्रदान (assign) करने के लिए किया जाता है।

operatorsdescriptionउदाहरणsame as
=यह बायीं तरफ के expression को वैल्यू assign करता है.x = 5x = 5
+=यह right operand को left operand से जोड़ता है तथा जो result आता है उसे left operand को assign करता है.x += 5x = x + 5
-=यह right operand को left operand में घटाता है तथा जो result आता है उसे left operand को assign करता है.x -= 5x = x – 5
*=यह right operand को left operand में गुणा करता है तथा जो result आता है उसे left operand को assign करता है.x *= 5x = x * 5
/=यह left operand को right operand से divide करता है तथा जो result आता है उसे left operand को assign करता है.x /= 5x = x / 5
%=यह दो operands का modulus लेता है और उसे left operand को assign करता है.x %= 5x = x % 5
**=यह operands में power (घात) को परफॉर्म करता है तथा उसे left operand को assign करता है.x **= 5x = x ** 5
//=यह operators में floor division को परफॉर्म करता है तथा उसे left operand को assign करता है.x //= 5x = x // 5

6. Identity Operators

Identity operators का उपयोग यह check करने के लिए किया जाता है कि दो variables एक ही memory location को refer करते हैं या नहीं।

OperatorDescriptionExample
isयदि दोनों variables समान होंa is b
is notयदि दोनों variables अलग होंa is not b

7. Membership Operators

Membership operators का उपयोग यह check करने के लिए किया जाता है कि कोई value किसी sequence (जैसे list, tuple, string) का हिस्सा है या नहीं।

OperatorDescriptionExample
inयदि value sequence में हैa in b
not inयदि value sequence में नहीं हैa not in b

इसे भी पढ़ें:-

निवेदन:- अगर आपको यह पोस्ट उपयोगी लगी हो तो इसे अपने दोस्तों के साथ अवश्य share कीजिए ताकि वो भी इसका लाभ ले सकें। धन्यवाद।

1 thought on “Operators in Python in Hindi – पायथन ऑपरेटर क्या है?”

Leave a Comment