Python Operators | पाइथन ऑपरेटर्स इन हिंदी

0

Python Operators | पाइथन ऑपरेटर्स इन हिंदी


आज किस पोस्ट में हम Python Operators के बारे में पढ़ेंगेऔर इसके Type के बारे में भी जानेंगे तो चलिए आज की सपोर्ट पोस्ट को शुरू करते हैं


Operator एक Symbol है जो कि एक Operation को प्रस्तुत करता है और वह वैल्यू जिस पर Operator कार्य Operate करते हैं उन्हें Operators कहते हैं Operators का इस्तिमल Program में data और Variable को manipulate करने के लिए किया जाता है


Operators wo Symbol होते हैं जिनका इस्तेमाल Program में (Calculation )गणितीय या Logical Operation करने के लिए किया जाता है


Python operators दो Type के होते हैं

Unary Operators और Binary Operators

Unary Operators केवल एक Operand पर operate होता है जबकि Binary Operators दो operand पर Operate होता है


For example

4+5 जहां 4 और 5 Operands है जबकि + प्लस एक ऑपरेटर है


Type Of Python Operators टाइप ऑफ पाइथन ऑपरेटर्स इन हिंदी


पाइथन ऑपरेटर कुछ इस तरह


  • Arithmetic operators
  • Relation comparison operators
  • Logical
  • Bitwise operator
  • Assignment operator
  • Identity operator
  • Membership operator


Arithmetic operators  का इस्तेमाल Calculations कार्यों को करने के लिए किया जाता है

जैसे Addition, subtraction, division इत्यादि.

यहाँ पर हमने कुछ Example के लिए Variable x का मान 50 और y का मान 100 लिया है

     Operators                                               Description                                                Example
 + Addition           यह दो operands को जोड़ता है।         x + y = 50    
 - Subtraction        यह दो operands को घटाता है।         x - y = 100
* Multiplication       यह दो operands को गुणा करता है।      x * y = 500   
 / Division           ये Right वाले operand से left          x / y = 1.5                     वाले operands को Divide करता है    
 % Modulus           यह Right वाले operands से left        x / y = 0                     वाले operand को divide करता हैं                         और शेषफल return करता है।  
 // floor division   यह Right वाले operand से left        13//3 = 4 और                     वाले operands को divide करता है        15//2 = 7                      और भागफल रिटर्न करता है 
                    ये दशमलव वाले हिस्से को छोड़ देता है।
 ** Exponential       इसमें Right वाला operand से left      x**y(x to to                    वाले power operand की घाट बन जाता है।   the power y)                                                         माना x=2, y=4                                                          तो x**y=1

Relational Comparison Operators

Relational operator ka इस्तिमाल दो value को Compare करने के लिए किया जाता है ये कन्डिशन के अनुसार या तो True Return करता है या False
यहाँ समझाने के लिए कुछ Variable x की Value 10 और y की value 20 दी है।
 ==          अगर दोनों operands की value समान होती है       x==y False                     तो condition True होती है 
 !=            अगर दोनों Operand की Value समान होती है        x!=y True                तो Condition True होती है 
 < >          अगर दोनों operands की value समान होती है        x<>y True             तो condition True होती है. ये != की तरह है 
 >            अगर left operand की value right operand से   x>y False               बड़ी होती है तो condition True होती है   
 <            अगर right operand की value left operand से   x<y True                बड़ी होती है तो condition True होती है 
 >=           अगर right operand की value right operand    x>=y False            से बड़ी या बराबर होती है तो condition True होती है 
 <=            अगर right operand की value left से बड़ी या   x<=y True                 छोटी होती है तो condition True होती है 

Logical Operators

logical Operators जो है वो Boolean Expressions को Compare करता है और Boolean Result Return करता है ।
  Operators                 Description                      Example                      
 and             अगर दोनों operands True होते हैन तो    6>5 and 10<20                condition True होती है।                     True
 or           अगर दो Operands में से एक भी True होता है      6<5 or 10>20                    तो Condition True होती है                   True 
 not          अगर operands की value गलत होती है तो          not (4<3)               condition True होती है                          True 

Bitwise Operators

bitwise python operators जो हिय वो bit पर काम करते हैं तथा bit by bit Operation को Perform करते हैं ।
 &                    bitwise AND                x & y = 0(0000 0000)
 |                    bitwise OR                 x|y = 14 (0000 1110)
 ~                    bitwise NOT               ~x= -11 (1111 0101)
 ^                    bitwise XOR               x^y = 14 (0000 1110)
 >>                   bitwise Right shift       x >> 2=2 (0000 0010)
 <<                   bitwise left shift        x<< 2= 40(0010 1000)

Assignment Operators

python men assignment operators ka इस्तिमल variable को value assign करने के लिए किया जाता है
 =       यह बाईं तरफ के expression को value assign करता है   x=5 
 +=         यह right operand को left operand से जोड़ता है        x +=5       और जो result आता  है उसे left operand को assign करता है 
 -=     ये right operand को left operand में घटाता है और         x -=5        जो result आता है उसे left operand को assign करता है 
*=        ये right operand को left operand में गुणा करता है         x *=5        और जो result आता है उसे left operand को assign करता है 
/=        ये left operand को right operand से divide करता है     x /=5        जो result आता है उसे left operand को assign करता है 
%=        यह दो operand का modulus लेता है उसे left operand     x %=5            को assign करता है 
**=        यह operands मे power (घात) को perform करता है      x **=5            और उसे left operand को assign करता है 
//=        ये operators में floor division को perform करता है     x //=5                और उसे left operand को assign करता है 
Next 
 python


एक टिप्पणी भेजें

0टिप्पणियाँ
एक टिप्पणी भेजें (0)
To Top