Blog

Operators in python in hindi - Bharosewale

Posted By Naveen Singh on 20 Mar 2023

python-program
python-me-operators-kya-hote-hai-in-hindi

Python में operators क्या होते हैं? (Operators in python in hindi?)

Operators in python definition-:

Python में operators एक तरह के symbols होते है, जिनकी सहायता से हम operations perform करते है।

Python में operators कई प्रकार के होते है -

1-: Arithmetic operator

2-: Assignment operator

3-: Relational operator

4-: Logical operator

5-: Increment/Decrement operator

6-: dual specialization operator

Operators in python with example

1-: Arithmetic operator-: इस operator का use हम common mathmatical operations को perform करने के लिए करते है।

 

a) addition(+)-:  इस operator का use  हम किन्हीं दो operands को add करने के लिए करते हैं।

Example-:

a = 5

b = 5

print("addition=", a+b)

Output-:

addition=10

 

b) Subtraction (-)-:  इस operator का use हम किन्हीं दो operands को subtract करने के लिए करते हैं।

Example-:

a = 6

b = 3

print("Subtraction=", a-b)

Output-:

Subtraction=2

 

c) Multiplication (*)-:  इस operator का use हम किन्हीं दो operands को multiply करने के लिए करते हैं।

Example-:

a = 2

b = 3

print("multiplication=", a*b)

Output-:

multiplication=6

 

d) Division(/)-: इस operator का use हम किन्हीं दो operands को divide करने के लिए करते हैं।

Example-:

a = 6

b = 2

print("Division=", a/b)

Output-:

Division=3

 

e) Modulus(%)-: इस operator को हम modulus/remainder भी कहते है, इस operator का use हम remainder value provide करने के लिए करते है।

Example-:

a = 6

b = 2

print("Modulus=", a%b)

Output-:

Modulus=0

 

f) Exponentiation (*)-: इस operator को हम * से denote करते है। इस operator का use हम power देने के लिए करते है।

Example-:

a = 2

b = 5

print("Exponentiation=", a**b)

Output-:

Exponentiation=32

 

g) Floor division(//)-: इस operator को हम // sign से denote करते हैं। इसका use हम floor value लेने के लिए करते है।

Example-:

a = 15

b = 2

print("Floor division=", a//b)

Output-:

Floor division=7


 

2-: Assignment operator-:  इस  operator का use हम किसी variable में value assign करने के लिए करते हैं। इसे हम equal(=) sign से denote करते है।

Example-:

x = 5


 

3-: Relational operator-:  इस operator का use हम किन्हीं दो operand के बीच relation बताने के लिए करते है।

a) Equal(==)-:   इस operator का use हम equlity बताने के लिए करते है।

Example-:

a = 5

b = 6

print(a==b)

Output-:

False

 

b) Not equal(!=)-: इस operator का use हम तब करते है जब कोई operand equal ना हो।

Example-:

a = 5

b = 6

print(a!=b)

Output-:

True

 

c) Greater than(>)-: इस operator का use हम दो operand में कौन सा greater है उसे पता लगाने के लिए करते है।

Example-:

a = 5

b = 6

print(a>b)

Output-:

False

 

d) Less than-: इस operator का use हम दो operand में कौन सा less than है उसे पता लगाने के लिए करते है।

Example-:

a = 5

b = 6

print(a<b)

Output-:

True

 

e) Greater than or Equal to(>=)-: इस operator का use हम कोई operand greater than or Equal है कि नहीं इसे पता लगाने के लिए करते है।

Example-:

a = 5

b = 6

print(a>=b)

Output-:

False

 

f) Less than or Equal to(<=)-: इस operator का use हम कोई operand Less than or Equal है कि नहीं इसे पता लगाने के लिए करते है।

Example-:

a = 5

b = 6

print(a<=b)

Output-:

True


 

4-: Logical operator-: इस operator का use हम logical operation को perform (and, or, not) के लिए करते है। ये basically तीन प्रकार के होते है -

a) and-: जब कोई दो statement true होती हैं तब यह True value return करता है।

Example-:

x = 6

print(x > 4 and x < 8)

Output-:

True

 

b)or-: जब कोई एक statement भी true होता हैं तब यह True value return करता है।

Example-:

x = 6

print(x > 4 or x > 8)

Output-:

True

c) not-: अगर result true होता है, तो यह false return करता है अगर false होता है तो यह true return करता है।

Example-:

a = 4

print(not(x > 3 and x < 10))

Output-:

False


5-: Increment/Decrement operator-: इस operator का use हम किसी value में increment या फिर decrement के लिए use करते है।

Example-:

x = 5

print("increment:", x=x+1)

print("decrement:", x=x-1)

Output-:

increment: 6

decrement: 4


 

6-: Dual specialization operator-: यह operator कई प्रकार के होते हैं-

x+=5 means x=x+5

x-=5  means x=x-5

x/=5 means x=x/5

x*=5 means x=x*5

x%=5 means x=x%

x//=5 means x=x//5

x*=5 means x=x*5


Conclusion
 

I Hope आपको Python में operators क्या होते है? operators python में कैसे work करता  है, और operators के types के बारे में आपको जानकारी मिली होगी। यदि आपको कोई doubt है तो comment section में comment करके पूछ सकते हैं।


 

Comments