Skip to main content

Operator's in Python पायथन में ऑपरेटर्स

Python supports various types of operators for performing operations on variables and values. Here are some common types of operators in Python:
पायथन वेरिएबल्स और मानों पर संचालन करने के लिए विभिन्न प्रकार के ऑपरेटरों का समर्थन करता है। यहां पायथन में कुछ सामान्य प्रकार के ऑपरेटर हैं:

1. Arithmetic Operators:

   + # Addition 
   - # Subtraction
   * # Multiplication
   / # Division
   % # Modulus (remainder)
   ** # Exponentiation
   // # Floor Division

2. Comparison Operators:
   
   == # Equal to
   != # Not equal to
   < # Less than
   > # Greater than
   <= # Less than or equal to
   >= # Greater than or equal to
   

3. Logical Operators:
  
   and # Logical AND
   or # Logical OR
   not # Logical NOT
  

4. Assignment Operators:
  
   = # Assignment
   += # Add and assign
   -= # Subtract and assign
   *= # Multiply and assign
   /= # Divide and assign
   
5. Identity Operators:
   
   is # Returns True if both variables are the same object
   is not # Returns True if both variables are not the same object
   

6. Membership Operators:
   
   in # Returns True if a value is present in a sequence
   not in # Returns True if a value is not present in a sequence
   
These operators allow you to perform a wide range of operations in Python. 
ये ऑपरेटर आपको पायथन में कई प्रकार के ऑपरेशन करने की अनुमति देते हैं।

In Python, operators have different precedence levels, which determine the order in which operations are performed in an expression. Understanding operator precedence helps in avoiding ambiguity and clarifying the order of operations in complex expressions. Here's a general overview of operator precedence, from highest to lowest:
पायथन में, ऑपरेटरों के पास अलग-अलग प्राथमिकता स्तर होते हैं, जो किसी अभिव्यक्ति में संचालन के क्रम को निर्धारित करते हैं। ऑपरेटर प्राथमिकता को समझने से अस्पष्टता से बचने और जटिल अभिव्यक्तियों में संचालन के क्रम को स्पष्ट करने में मदद मिलती है। यहां उच्चतम से निम्नतम तक ऑपरेटर प्राथमिकता का सामान्य अवलोकन दिया गया है:

1. Parentheses ( )

2. Exponentiation **

3. Unary Operators: unary plus +x , unary minus -x , bitwise NOT ~x

4. Multiplication *, Division /, Modulus %

5. Addition + , Subtraction -

6. Bitwise Left Shift Operator<< , Bitwise Right Shift Operator >> 

7. Bitwise AND &

8. Bitwise XOR ^

9. Bitwise OR |

10. Comparison Operators
    == , !=, <, >, <=, >=

11. Logical NOT not

12. Logical AND and

13. Logical OR or

14. Conditional Expression (Ternary Operator)
    x if condition else y

15. Assignment Operators
    =, +=, -=, *=, /=, etc

Comments

Popular posts from this blog

Python IDLE पायथन आईडीएलई (इंटीग्रेटेड डेवलपमेंट एंड लर्निंग एनवायरनमेंट)

IDLE (Integrated Development and Learning Environment) is a graphical user interface (GUI) for the Python programming language. It includes the Python standard library and provides a convenient environment for writing, running, and debugging Python code. IDLE (इंटीग्रेटेड डेवलपमेंट एंड लर्निंग एनवायरनमेंट) पायथन प्रोग्रामिंग भाषा के लिए एक ग्राफिकल यूजर इंटरफेस (GUI) है। इसमें पायथन मानक लाइब्रेरी शामिल है और पायथन कोड लिखने, चलाने और डीबग करने के लिए एक सुविधाजनक वातावरण प्रदान करता है।  Key features of IDLE are:- आईडीएलई की मुख्य विशेषताएं हैं:-  1. Interactive Shell:- IDLE provides an interactive Python shell, allowing you to execute Python commands and see the immediate results. 1. इंटरएक्टिव शेल:- आईडीएलई एक इंटरैक्टिव पायथन शेल प्रदान करता है, जो आपको पायथन कमांड निष्पादित करने और तत्काल परिणाम देखने की अनुमति देता है।  2. Script Editor:- It includes a text editor for writing Python scripts. You can create, edit, and save Python files with a ".py" extension. 2. स्क्...

Programming with Python Language Tutorial available in hindi and english पाइथन प्रोग्रामिंग टुटोरिअल हिंदी एवं अंग्रेजी भाषा में

 Unit -01 1. Introduction to python (पाइथन भाषा का परिचय) 2. History of Python Programming Language पाइथन प्रोग्रामिंग लैंग्वेज का इतिहास 3. Python Programming Language’s Features and Advantages पायथन प्रोग्रामिंग लैंग्वेज की प्रमुख विशेषताएं 4. Python’s Programming Language's Popularity पाइथन प्रोग्रामिंग लैंग्वेज की लोकप्रियता 5.The Future of Python Programming Language पायथन प्रोग्रामिंग लैंग्वेज का भविष्य 6. The Python Interpreter पायथन इंटरप्रेटर 7. The Python IDLE पाइथन आईडीएलई 8. Installation process of Python IDLE पायथन आईडीएलई की इंस्टालेशन प्रक्रिया 9. Dynamically typed and strongly typed features of python गतिशील रूप से टाइप और दृढ़ता से टाइप की गई भाषा पायथन 10. Basic Data Types of Python पायथन के बेसिक डेटा टाइप 11. Variables in python पायथन में वेरिएबल 12. Expressions in Python पायथन में अभिव्यक्तियां 13. Statements in Python पायथन में कथन 14. Operator's in Python पायथन में ऑपरेटर्स 15. Flow of execution of a python program पाइथन प्रोग्राम के निष्पादन का प्रवाह 16...