{"id":65241,"date":"2022-06-29T06:24:22","date_gmt":"2022-06-29T06:24:22","guid":{"rendered":"https:\/\/itsourcecode.com\/?p=65241"},"modified":"2023-10-25T05:25:00","modified_gmt":"2023-10-25T05:25:00","slug":"operators-in-python","status":"publish","type":"post","link":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/","title":{"rendered":"Logical Operators in Python with Examples: Comprehensive Guide"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-what-is-an-operator-in-python\"><strong>What is an Operator in Python?<\/strong><\/h2>\n\n\n\n<p><strong>Operators in Python<\/strong> are special symbols that perform arithmetic or logical computations. The value that the operator works on is called the &#8220;operand.&#8221; <\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-does-the-operator-do-in-python\"><strong>What does the operator do in Python?<\/strong><\/h2>\n\n\n\n<p><strong>Operators in Python<\/strong> are used to manipulate data and perform various computations. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Python provides a wide range of operators that serve different purposes.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-different-types-of-operators-in-python\"><strong>Different Types of Operators in Python<\/strong><\/h2>\n\n\n\n<p>Here are the <strong>different types of operators in Python<\/strong>:<\/p>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Logical Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Arithmetic Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Comparison (Relational) Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Bitwise Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Assignment Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Membership Operators<\/li>\n<\/ul>\n\n\n\n<ul class=\"is-style-default wp-block-list\">\n<li>Identity Operators<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-are-logical-operators-in-python\"><strong>What are logical operators in Python?<\/strong><\/h2>\n\n\n\n<p>The Python logical operators are <em>and, or,<\/em> and <em>not<\/em>. They are used to combine and manipulate boolean values.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Operator<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Meaning<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">and<\/td><td class=\"has-text-align-center\" data-align=\"center\">If both operands are true, then this is true.<\/td><td class=\"has-text-align-center\" data-align=\"center\">a and b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">or<\/td><td class=\"has-text-align-center\" data-align=\"center\">True if one of the operands is true.<\/td><td class=\"has-text-align-center\" data-align=\"center\">a or b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">not<\/td><td class=\"has-text-align-center\" data-align=\"center\">If the operand is false, the condition is true (complements the operand)<\/td><td class=\"has-text-align-center\" data-align=\"center\">not a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-logical-operator-example\"><strong>Logical Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = True\nb = False\n\nprint('a and b is',a and b)\n\nprint('a or b is',a or b)\n\nprint('not a is',not a)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a and b is False\na or b is True\nnot a is False<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to use logical operators in Python?<\/strong><\/h2>\n\n\n\n<p>Here&#8217;s how to use logical operators based on the truth table for the logical operators &#8220;and&#8221;, &#8220;or&#8221;, and &#8220;not&#8221; in Python.<\/p>\n\n\n\n<p>Logical AND (operator: and):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>| Operand 1 | Operand 2 | Result |\n|-----------|-----------|--------|\n|   False   |   False   | False  |\n|   False   |   True    | False  |\n|   True    |   False   | False  |\n|   True    |   True    | True   |<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Logical OR (operator: or):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>| Operand 1 | Operand 2 | Result |\n|-----------|-----------|--------|\n|   False   |   False   | False  |\n|   False   |   True    | True   |\n|   True    |   False   | True   |\n|   True    |   True    | True   |<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Logical NOT (operator: not):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>| Operand | Result |\n|---------|--------|\n|  False  |  True  |\n|  True   | False  |<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>These truth tables illustrate the output that each logical operator will produce based on the truth values of its operands.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Here are other operators in Python you can utilize.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-comparison-operators-in-python\"><strong>Comparison Operators in Python<\/strong><\/h3>\n\n\n\n<p><strong>Value comparison<\/strong> is done using <strong>comparison operators<\/strong>. Depending on the criteria, it returns <em>True or False<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Operator<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Meaning<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">&gt;<\/td><td class=\"has-text-align-center\" data-align=\"center\">Less than &#8211; True if the left operand is less than the right<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&lt;<\/td><td class=\"has-text-align-center\" data-align=\"center\">Greater than or equal to &#8211; True if the left operand is greater than or equal to the right<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">==<\/td><td class=\"has-text-align-center\" data-align=\"center\">Equal to &#8211; True if both operands are equal<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">!=<\/td><td class=\"has-text-align-center\" data-align=\"center\">Not equal to &#8211; True if operands are not equal<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&gt;=<\/td><td class=\"has-text-align-center\" data-align=\"center\">Less than or equal to &#8211; True if the left operand is less than or equal to the right<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&lt;=<\/td><td class=\"has-text-align-center\" data-align=\"center\">Less than or equal to &#8211; True if left operand is less than or equal to the right<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-comparison-operator-example\"><strong>Comparison Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = 10\nb = 12\n\n# Output: a &gt; b is False\nprint('a &gt; b is',a&gt;b)\n\n# Output: a &lt; b is True\nprint('a &lt; b is',a&lt;b)\n\n# Output: a == b is False\nprint('a == b is',a==b)\n\n# Output: a != b is True\nprint('a != b is',a!=b)\n\n# Output: a &gt;= b is False\nprint('a &gt;= b is',a&gt;=b)\n\n# Output: a &lt;= b is True\nprint('a &lt;= b is',a&lt;=b)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a &gt; b is False\na &lt; b is True\na == b is False\na != b is True\na &gt;= b is False\na &lt;= b is True\n<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-arithmetic-operators\"><strong>Python Arithmetic Operators<\/strong><\/h2>\n\n\n\n<p><strong>Arithmetic operators<\/strong> are used in mathematics to accomplish operations such as <em>addition, subtraction, multiplication, and so on<\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Operator<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Meaning<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Example<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">+<\/td><td class=\"has-text-align-center\" data-align=\"center\">Add two operands or unary plus<\/td><td class=\"has-text-align-center\" data-align=\"center\">a + b + 2<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&#8211;<\/td><td class=\"has-text-align-center\" data-align=\"center\">Subtract the right operand from the unary minus.<\/td><td class=\"has-text-align-center\" data-align=\"center\">a &#8211; b &#8211; 2<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">*<\/td><td class=\"has-text-align-center\" data-align=\"center\">Multiplies the values on either side of the operator.<\/td><td class=\"has-text-align-center\" data-align=\"center\">a * b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\/<\/td><td class=\"has-text-align-center\" data-align=\"center\">Division Operators divide numbers and return a quotient.<\/td><td class=\"has-text-align-center\" data-align=\"center\">a \/ b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">%<\/td><td class=\"has-text-align-center\" data-align=\"center\">Modulus &#8211; the remainder of the division of the left operand by the right operand<\/td><td class=\"has-text-align-center\" data-align=\"center\">a % b (remainder of a\/b)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\/\/<\/td><td class=\"has-text-align-center\" data-align=\"center\">Floor division &#8211; a division that returns a whole number moved to the left on the number line<\/td><td class=\"has-text-align-center\" data-align=\"center\">a \/\/ b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">**<\/td><td class=\"has-text-align-center\" data-align=\"center\">Exponent &#8211; left operand raised to the power of right<\/td><td class=\"has-text-align-center\" data-align=\"center\">a**b (a to the power b)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-arithmetic-operator-example\"><strong>Arithmetic Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = 15\nb = 4\n\n# Output: a + b = 19\nprint('a + b =',a+b)\n\n# Output: a - b = 11\nprint('a - b =',a-b)\n\n# Output: a * b = 60\nprint('a * b =',a*b)\n\n# Output: a \/ b = 3.75\nprint('a \/ b =',a\/b)\n\n# Output: a \/\/ b = 3\nprint('a \/\/ b =',a\/\/b)\n\n# Output: a ** b = 50625\nprint('a ** b =',a**b)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a + b = 19\na - b = 11\na * b = 60\na \/ b = 3.75\na \/\/ b = 3\na ** b = 50625<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-bitwise-operators\"><strong>Python Bitwise Operators<\/strong><\/h2>\n\n\n\n<p><strong>Bitwise operators<\/strong> in Python operate bit by bit and operate on bits.<\/p>\n\n\n\n<p>For example<strong> <em>a = 60<\/em><\/strong> and <em><strong>b = 13<\/strong><\/em>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In this case, their values in binary form would be <strong><em>a = 0011 1100<\/em><\/strong> and <strong><em>b = 0000 1101<\/em><\/strong>, respectively.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Operator<\/th><th>Meaning<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>&amp;<\/td><td>Bitwise AND<\/td><td>a &amp; b = 0 (<code>0000 0000<\/code>)<\/td><\/tr><tr><td>|<\/td><td>Bitwise OR<\/td><td>a | b = 14 (<code>0000 1110<\/code>)<\/td><\/tr><tr><td>~<\/td><td>Bitwise NOT<\/td><td>~a = -11 (<code>1111 0101<\/code>)<\/td><\/tr><tr><td>^<\/td><td>Bitwise XOR<\/td><td>a ^ b = 14 (<code>0000 1110<\/code>)<\/td><\/tr><tr><td>&gt;&gt;<\/td><td>Bitwise right shift<\/td><td>a &gt;&gt; 2 = 2 (<code>0000 0010<\/code>)<\/td><\/tr><tr><td>&lt;&lt;<\/td><td>Bitwise left shift<\/td><td>a &lt;&lt; 2 = 40 (<code>0010 1000<\/code>)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-bitwise-operator-example\"><strong>Bitwise Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = 60            # 60 = 0011 1100 \nb = 13            # 13 = 0000 1101 \nc = 0\n\nc = a &amp; b;        # 12 = 0000 1100\nprint (\"Line 1 - Value of c is \", c)\n\nc = a | b;        # 61 = 0011 1101 \nprint (\"Line 2 - Value of c is \", c)\n\nc = a ^ b;        # 49 = 0011 0001\nprint (\"Line 3 - Value of c is \", c)\n\nc = ~a;           # -61 = 1100 0011\nprint (\"Line 4 - Value of c is \", c)\n\nc = a &lt;&lt; 2;       # 240 = 1111 0000\nprint (\"Line 5 - Value of c is \", c)\n\nc = a &gt;&gt; 2;       # 15 = 0000 1111\nprint (\"Line 6 - Value of c is \", c)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Line 1 - Value of c is  12\nLine 2 - Value of c is  61\nLine 3 - Value of c is  49\nLine 4 - Value of c is  -61\nLine 5 - Value of c is  240\nLine 6 - Value of c is  15<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-assignment-operators-in-python\"><strong>Assignment Operators in Python<\/strong><\/h2>\n\n\n\n<p>In Python, <strong>assignment operators<\/strong> are used to give variable values.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>For example, a += 5 adds 5 to a variable and then assigns it. It has the same meaning as <strong><em>a = a + 5<\/em><\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Operator<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Example<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Equivalent to<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">+=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a += 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a + 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">-=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a -= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a &#8211; 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">*=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a *= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a * 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\/=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a \/= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a \/ 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">%=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a %= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a % 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">\/\/=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a \/\/= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a \/\/ 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">**=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a **= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a ** 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&amp;=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a &amp;= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a &amp; 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">|=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a |= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a | 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">^=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a ^= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a ^ 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&gt;&gt;=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a &gt;&gt;= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a &gt;&gt; 5<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">&lt;&lt;=<\/td><td class=\"has-text-align-center\" data-align=\"center\">a &lt;&lt;= 5<\/td><td class=\"has-text-align-center\" data-align=\"center\">a = a &lt;&lt; 5<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Assignment Operators in Python<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-assignment-operator-example\"><strong><strong>Assignment Operator Example:<\/strong><\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = 25\nb = 5\nc = 0\n\nc = a + b\nprint (\"Line 1 - Value of c is \", c)\n\nc += a\nprint (\"Line 2 - Value of c is \", c)\n\nc *= a\nprint (\"Line 3 - Value of c is \", c)\n\nc \/= a \nprint (\"Line 4 - Value of c is \", c)\n\nc  = 2\nc %= a\nprint (\"Line 5 - Value of c is \", c)\n\nc **= a\nprint (\"Line 6 - Value of c is \", c)\n\nc \/\/= a\nprint (\"Line 7 - Value of c is \", c)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Line 1 - Value of c is  30\nLine 2 - Value of c is  55\nLine 3 - Value of c is  1375\nLine 4 - Value of c is  55.0\nLine 5 - Value of c is  2\nLine 6 - Value of c is  33554432\nLine 7 - Value of c is  1342177<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-membership-operators\"><strong>Membership Operators<\/strong><\/h2>\n\n\n\n<p>The <strong>membership operators in Python<\/strong> are <strong><em>in<\/em><\/strong> and <strong><em>not in<\/em><\/strong>. They are used to determine if a value or variable can be found in a sequence (string, list, tuple, set, and dictionary).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In a <strong>dictionary<\/strong>, we can only check if the key is there, not if the value is there.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Operator<\/th><th>Meaning<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>in<\/td><td>True if the value or variable is in the sequence.<\/td><td>5 in a<\/td><\/tr><tr><td>not in<\/td><td>True if value or variable is not found in the sequence<\/td><td>5 not in a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-membership-operator-example\"><strong>Membership Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a = 'Hello world'\nb = {1:'a',2:'b'}\n\n# Output: True\nprint('H' in a)\n\n# Output: True\nprint('hello' not in a)\n\n# Output: True\nprint(1 in b)\n\n# Output: False\nprint('a' in b)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>True\nTrue\nTrue\nFalse<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Here, <strong><em>&#8216;H&#8217;<\/em><\/strong> is in <strong><em>a<\/em><\/strong>, but <strong><em>&#8216;hello&#8217;<\/em><\/strong> is not in <strong><em>a<\/em><\/strong>. (remember, Python is case sensitive). In the same way, <strong><em>1<\/em><\/strong> is the key, and <strong><em>&#8216;a&#8217;<\/em><\/strong> is the value in dictionary <strong><em>b<\/em><\/strong>. So, <strong><em>&#8216;a&#8217;<\/em><\/strong> in <strong>b<\/strong> returns False.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-identity-operators\"><strong>Identity Operators<\/strong><\/h2>\n\n\n\n<p>In Python, the <strong>identity operators<\/strong> are <strong><em>is<\/em><\/strong> and <strong><em>is not<\/em><\/strong>. They are used to see if two values (or variables) are located on the same part of memory. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Even if two variables are identical, this does not indicate that they represent the same object.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Operator<\/th><th>Meaning<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>is<\/td><td>True if the operands are identical (refer to the same object)<\/td><td>a is True<\/td><\/tr><tr><td>is not<\/td><td>True if the operands are not identical (do not refer to the same object)<\/td><td>a is not True<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-identity-operator-example\"><strong>Identity Operator Example:<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>a1 = 5\nb1 = 5\na2 = 'Hello'\nb2 = 'Hello'\na3 = &#91;1,2,3]\nb3 = &#91;1,2,3]\n\n# Output: False\nprint(a1 is not b1)\n\n# Output: True\nprint(a2 is b2)\n\n# Output: False\nprint(a3 is b3)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>False\nTrue\nFalse<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Here, we can see that <strong><em>a1<\/em><\/strong> and<strong><em> b1<\/em><\/strong> are both integers with the same value. This means that they are both equal and the same. The same is <strong>true <\/strong>for <strong><em>a2<\/em><\/strong> and <strong><em>b2<\/em><\/strong> (strings).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>But <strong><em>a3<\/em><\/strong> and <strong><em>b3<\/em><\/strong> are both lists. They are the same, but not the same because the interpreter puts them in different places in his or her memory, even though they are the same.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Python Precedence<\/strong><\/h2>\n\n\n\n<p>The table below displays operator precedence from most to least important.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th>Operator<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>**<\/td><td>Exponentiation (raise to the power)<\/td><\/tr><tr><td>~ + &#8211;<\/td><td>Complement, unary plus and minus (method names for the last two are +@ and -@)<\/td><\/tr><tr><td>* \/ % \/\/<\/td><td>Multiply, divide, modulo, and floor division<\/td><\/tr><tr><td>+ &#8211;<\/td><td>Addition and subtraction<\/td><\/tr><tr><td>&gt;&gt; &lt;&lt;<\/td><td>Right and left bitwise shift<\/td><\/tr><tr><td>&amp;<\/td><td>Bitwise &#8216;AND&#8217;td&gt;<\/td><\/tr><tr><td>^ |<\/td><td>Bitwise exclusive `OR&#8217; and regular `OR&#8217;<\/td><\/tr><tr><td>&lt;= &lt; &gt; &gt;=<\/td><td>Comparison operators<\/td><\/tr><tr><td>&lt;&gt; == !=<\/td><td>Equality operators<\/td><\/tr><tr><td>= %= \/= \/\/= -= += *= **=<\/td><td>Assignment operators<\/td><\/tr><tr><td>is is not<\/td><td>Identity operators<\/td><\/tr><tr><td>in not in<\/td><td>Membership operators<\/td><\/tr><tr><td>not or and<\/td><td>Logical operators<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Python Operators Precedence<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>In summary, <strong>Operators in Python<\/strong> are what make Python work. Operators can be used to do a lot of different things, like add two numbers or give a variable a value.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Now that we know what operators are, we are one step closer to writing better and more efficient codes. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>So, start using all the operators you&#8217;ve learned today in your code.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns tw-mb-0 tw-stretched-blocks tw-justify-center tw-gutter-no tw-cols-stack-sm tw-cols-card tw-cols-card-border tw-stretched-link is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-left is-nowrap is-layout-flex wp-container-core-buttons-is-layout-558b13e7 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-variable-types\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">\u2770\u2770<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Previous<\/strong><\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-left tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\"><strong>Python Variable Types<\/strong><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column tw-mt-0 tw-mb-0 is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-right is-nowrap is-layout-flex wp-container-core-buttons-is-layout-5054138e wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-decision-making-statements\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Next <\/strong>\u2771\u2771<\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-right tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\"><strong>Python Decision-Making Statements<\/strong><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is an Operator in Python? Operators in Python are special symbols that perform arithmetic or logical computations. The value that the operator works on is called the &#8220;operand.&#8221; What &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Logical Operators in Python with Examples: Comprehensive Guide\" class=\"read-more button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#more-65241\" aria-label=\"Read more about Logical Operators in Python with Examples: Comprehensive Guide\">Read more<\/a><\/p>\n","protected":false},"author":1373,"featured_media":66395,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61036],"tags":[82072,82089,81858,81814,81854,81988,81869,81994,81974,81853,81852,81911,81805,81828,81990,83055,81873,81903,83048,81824,81909,82037,81817,81816,81871,81907,81864,81830,81846,81968,81942,82032,81956,81948,81991,82054,82061,81831,81925,82053,81983,81812,81861,81806,81996,81807,81859,82004,81891,81822,82025,82058,82077,81947,81920,81862,81855,81930,81849,81857,81894,82015,81960,81952,82067,82029,82084,82059,81924,81892,82022,81972,81881,82048,81900,81962,82000,81955,82021,81863,81898,81845,82003,81967,82079,82082,82028,82034,81953,81890,81860,81847,81843,82047,81908,81893,81841,81961,82081,82060,82013,81927,81970,81868,81935,82076,81945,82086,81840,81938,81901,82065,82016,81808,81838,82062,81821,81842,81984,81993,81985,81912,82017,81965,81856,81870,82085,81946,81981,81922,82033,81872,81887,82008,81818,82027,82083,81916,81982,82020,81809,81883,81958,81878,81905,81879,82010,82051,82064,82066,82057,81913,82012,82087,82071,81914,82024,82049,81867,81980,81987,81959,81897,81941,82042,81896,81979,82044,81975,81923,81992,81989,81957,81839,82073,81836,81851,81919,82043,82007,81939,81969,81978,82080,81837,82040,81937,81928,82018,82002,82045,81986,81884,81963,81866,81889,82005,81971,81926,81876,82078,82014,81811,81918,82009,81865,81833,81910,81844,82046,81888,81820,82050,81997,82038,82001,81877,81932,81850,82074,81827,81835,81976,81813,81834,81874,81882,82088,82023,81944,81998,81899,81943,81940,82006,81848,82063,81875,82035,81915,81826,81977,82026,82019,81819,82030,82039,81931,81973,81885,81810,81825,82052,82068,82031,81964,81880,81954,82036,81823,81921,81999,81936,81917,82041,82075,81949,81933,81929,81966,82055,81950,83051,83049,81995,82056,81832,83050,83054,83046,83052,81895,82011,81904,83053,83047,82070,81886,82069,81934,81906,79979,81902,81951,81829,81815],"class_list":["post-65241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorial","tag-4-python-operators","tag-airflow-with-python-operator","tag-and-operator-python-if-statement","tag-conditional-operator-in-python","tag-different-python-operator","tag-do-operator-python","tag-does-python-have-operator","tag-how-does-python-in-operator-work","tag-how-does-python-operator-work","tag-how-many-membership-operator-in-python","tag-how-many-operators-are-there-in-python","tag-how-many-operators-are-used-in-python","tag-how-many-types-of-operators-used-in-python","tag-how-much-python-developer-earn-in-india","tag-how-much-python-is-required-for-job","tag-how-to-use-and-operator-in-python","tag-if-python-or-operator","tag-in-python-operators","tag-is-operator-in-python","tag-is-operator-python","tag-is-operator-python-3","tag-is-python-operator","tag-modulo-operator-in-python","tag-modulus-operator-in-python","tag-near-by-python-course","tag-near-operator-example","tag-near-python-institute","tag-operators-in-python-geeksforgeeks","tag-order-of-python-operators","tag-python-2-operator-itemgetter","tag-python-2-operator-precedence","tag-python-2-operators","tag-python-2-7-operator-overloading","tag-python-2-7-operators","tag-python-3-operator-lt","tag-python-3-operator-module","tag-python-3-operator-overloading","tag-python-3-operators","tag-python-3-8-operators","tag-python-3-9-operators","tag-python-991-owners-manual","tag-python-and-operator","tag-python-and-operator-example","tag-python-arithmetic-operators","tag-python-arithmetic-operators-questions","tag-python-assignment-operator","tag-python-assignment-operators-explained","tag-python-bitwise-operators-in-16-bit","tag-python-boolean-operators-youtube","tag-python-equal-operator","tag-python-has-operator","tag-python-hash-operator","tag-python-heap-operations","tag-python-hex-operations","tag-python-how-many-operators","tag-python-in-operator-dictionary","tag-python-in-operator-list","tag-python-in-operator-overloading","tag-python-in-operator-string","tag-python-in-operator-time-complexity","tag-python-is-operator-boolean","tag-python-is-operator-example","tag-python-is-operator-int","tag-python-is-operator-not-working","tag-python-is-operator-overloading","tag-python-is-operator-precedence","tag-python-is-operator-strings","tag-python-j-operator","tag-python-jinja2-operator","tag-python-join-operator","tag-python-json-operators","tag-python-key-operator","tag-python-kopf-operator","tag-python-kubernetes-operator-framework","tag-python-like-operator-pandas","tag-python-like-statement-mysql","tag-python-list-operations-1-hackerrank-solution","tag-python-list-operations-2-hackerrank-solution","tag-python-modulo-operator-0","tag-python-not-operator-example","tag-python-operations-between-lists","tag-python-operations-on-strings","tag-python-operations-queue","tag-python-operator-3-dots","tag-python-operator-airflow-1-10","tag-python-operator-airflow-2","tag-python-operator-always-yields-the-result-of","tag-python-operator-and-not","tag-python-operator-binding","tag-python-operator-dag","tag-python-operator-div","tag-python-operator-example-airflow","tag-python-operator-framework","tag-python-operator-get","tag-python-operator-getitem-example","tag-python-operator-github","tag-python-operator-greater-than","tag-python-operator-greater-than-or-equal-to","tag-python-operator-hat","tag-python-operator-javascript","tag-python-operator-jupyter","tag-python-operator-keyword","tag-python-operator-lambda","tag-python-operator-less-than-or-equal-to","tag-python-operator-like","tag-python-operator-like-c","tag-python-operator-negation","tag-python-operator-norm","tag-python-operator-not","tag-python-operator-or-boolean","tag-python-operator-or-lambda","tag-python-operator-or-list","tag-python-operator-or-slash","tag-python-operator-overloading","tag-python-operator-overloading-assignment","tag-python-operator-overloading-different-types","tag-python-operator-precedence-examples","tag-python-operator-precedence-order","tag-python-operator-question-mark","tag-python-operator-range","tag-python-operator-reduce","tag-python-operator-remainder","tag-python-operator-responsible-for-declaring-variables","tag-python-operator-retries","tag-python-operator-return-value","tag-python-operator-ternary","tag-python-operator-tilde","tag-python-operator-truediv","tag-python-operator-unary","tag-python-operator-union","tag-python-operator-unzip","tag-python-operator-variable","tag-python-operator-venv","tag-python-operator-vertical-line","tag-python-operator-vs","tag-python-operator-vs-branchpythonoperator","tag-python-operator-vs-expression","tag-python-operator-vs-function","tag-python-operator-yield","tag-python-operator-zip","tag-python-operators","tag-python-operators-airflow","tag-python-operators-and","tag-python-operators-and-control-flow-statements","tag-python-operators-and-control-flow-statements-mcq","tag-python-operators-and-expressions","tag-python-operators-and-expressions-with-examples","tag-python-operators-and-methods","tag-python-operators-and-operands","tag-python-operators-and-their-meaning","tag-python-operators-arithmetic","tag-python-operators-as-functions","tag-python-operators-associativity","tag-python-operators-between","tag-python-operators-bit","tag-python-operators-bitwise","tag-python-operators-boolean","tag-python-operators-by-durga-sir","tag-python-operators-cheat-sheet","tag-python-operators-cheat-sheet-pdf","tag-python-operators-class","tag-python-operators-class-11","tag-python-operators-class-9","tag-python-operators-code","tag-python-operators-comparison","tag-python-operators-contains","tag-python-operators-definition","tag-python-operators-dictionary","tag-python-operators-different","tag-python-operators-division","tag-python-operators-documentation","tag-python-operators-equality","tag-python-operators-equivalent","tag-python-operators-example","tag-python-operators-example-programs","tag-python-operators-exercises","tag-python-operators-explained","tag-python-operators-exponents","tag-python-operators-float","tag-python-operators-for-class","tag-python-operators-for-comparison","tag-python-operators-for-strings","tag-python-operators-format","tag-python-operators-functions","tag-python-operators-geeksforgeeks","tag-python-operators-getattr","tag-python-operators-grouping","tag-python-operators-has-the-highest-precedence","tag-python-operators-has-the-lowest-precedence","tag-python-operators-hierarchy","tag-python-operators-if-statement","tag-python-operators-import","tag-python-operators-in-airflow","tag-python-operators-in-class","tag-python-operators-in-hindi","tag-python-operators-in-java","tag-python-operators-in-javatpoint","tag-python-operators-in-python","tag-python-operators-interview-questions","tag-python-operators-javatpoint","tag-python-operators-less-than","tag-python-operators-library","tag-python-operators-list","tag-python-operators-list-pdf","tag-python-operators-magic-methods","tag-python-operators-math","tag-python-operators-mcq","tag-python-operators-meaning","tag-python-operators-module","tag-python-operators-multiplication","tag-python-operators-names","tag-python-operators-not-equal","tag-python-operators-notes","tag-python-operators-numeric","tag-python-operators-on-set","tag-python-operators-or","tag-python-operators-order","tag-python-operators-order-of-precedence","tag-python-operators-overloading","tag-python-operators-package","tag-python-operators-pdf","tag-python-operators-ppt","tag-python-operators-practice-questions","tag-python-operators-precedence","tag-python-operators-programs","tag-python-operators-questions","tag-python-operators-questions-and-answers","tag-python-operators-redefine","tag-python-operators-set","tag-python-operators-shortcut","tag-python-operators-slideshare","tag-python-operators-split","tag-python-operators-string","tag-python-operators-symbols","tag-python-operators-syntax","tag-python-operators-table","tag-python-operators-that-can-be-overloaded","tag-python-operators-tutorialspoint","tag-python-operators-types","tag-python-operators-unary-and-binary-priorities-and-binding","tag-python-operators-w3schools","tag-python-operators-while","tag-python-operators-while-loop","tag-python-operators-with-example-pdf","tag-python-operators-with-examples","tag-python-operators-with-numbers","tag-python-operators-with-sets","tag-python-operators-worksheet","tag-python-operators-write","tag-python-operators-youtube","tag-python-or-operator","tag-python-or-operator-in-if","tag-python-or-operators","tag-python-pipe-operator-like-r","tag-python-quaternary-operator","tag-python-query-operators","tag-python-quotient-operator","tag-python-star-operator-zip","tag-python-string-operations-1","tag-python-string-operations-1-hackerrank-solution","tag-python-string-operations-2-hackerrank-solution","tag-python-unary-operator-if","tag-python-unary-operator-overloading","tag-python-what-is-operator-overloading","tag-python-xml-operations","tag-python-xnor-operator","tag-python-xor-operator-boolean","tag-python-xor-operator-list","tag-python-xor-operator-string","tag-python-y-operator","tag-using-not-operator-in-python","tag-using-python-operator","tag-what-are-logical-operators-in-python","tag-what-are-operators-in-python","tag-what-are-python-comparison-operators","tag-what-are-python-logical-operators","tag-what-are-python-operators","tag-what-arithmetic-operators-cannot-be-used-with-strings-in-python","tag-what-is-membership-operator-in-python","tag-what-is-operator-in-python","tag-what-is-operator-overloading-in-python","tag-what-is-python-operator-in-airflow","tag-what-is-python-operator-module","tag-where-operator-python","tag-which-function-overloads-the-operator-in-python","tag-which-of-the-following-is-exponential-operator-in-python","tag-which-python-operator-has-the-highest-precedence","tag-which-python-operator-has-the-lowest-precedence","tag-which-python-operator-have-higher-precedence","tag-which-python-operator-indicates-integer-division","tag-which-python-operator-is-responsible-for-declaring-variables","tag-why-python-is-used","tag-why-python-operator","tag-why-use-bitwise-operators-python","tag-with-operator-in-python","tag-xor-operator-in-python","resize-featured-image"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Logical Operators in Python with Examples: Comprehensive Guide<\/title>\n<meta name=\"description\" content=\"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Logical Operators in Python with Examples: Comprehensive Guide\" \/>\n<meta property=\"og:description\" content=\"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Itsourcecode.com\" \/>\n<meta property=\"article:author\" content=\"www.facebook.com\/unguardable7\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-29T06:24:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-25T05:25:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1460\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Ly Cesar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/www.twitter.com\/unguardable0729\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prince Ly Cesar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/\"},\"author\":{\"name\":\"Prince Ly Cesar\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\"},\"headline\":\"Logical Operators in Python with Examples: Comprehensive Guide\",\"datePublished\":\"2022-06-29T06:24:22+00:00\",\"dateModified\":\"2023-10-25T05:25:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/\"},\"wordCount\":1108,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png\",\"keywords\":[\"4 python operators\",\"airflow with python operator\",\"and operator python if statement\",\"conditional operator in python\",\"different python operator\",\"do operator python\",\"does python have operator\",\"how does python in operator work\",\"how does python operator work\",\"how many membership operator in python\",\"how many operators are there in python\",\"how many operators are used in python\",\"how many types of operators used in python\",\"how much python developer earn in india\",\"how much python is required for job\",\"how to use and operator in python\",\"if python or operator\",\"in python operators\",\"is operator in python\",\"is operator python\",\"is operator python 3\",\"is python operator\",\"modulo operator in python\",\"modulus operator in python\",\"near by python course\",\"near operator example\",\"near python institute\",\"operators in python geeksforgeeks\",\"order of python operators\",\"python 2 operator itemgetter\",\"python 2 operator precedence\",\"python 2 operators\",\"python 2.7 operator overloading\",\"python 2.7 operators\",\"python 3 operator lt\",\"python 3 operator module\",\"python 3 operator overloading\",\"python 3 operators\",\"python 3.8 operators\",\"python 3.9 operators\",\"python 991 owners manual\",\"python and operator\",\"python and operator example\",\"python arithmetic operators\",\"python arithmetic operators questions\",\"python assignment operator\",\"python assignment operators explained\",\"python bitwise operators in 16 bit\",\"python boolean operators youtube\",\"python equal operator\",\"python has operator\",\"python hash operator\",\"python heap operations\",\"python hex operations\",\"python how many operators\",\"python in operator dictionary\",\"python in operator list\",\"python in operator overloading\",\"python in operator string\",\"python in operator time complexity\",\"python is operator boolean\",\"python is operator example\",\"python is operator int\",\"python is operator not working\",\"python is operator overloading\",\"python is operator precedence\",\"python is operator strings\",\"python j operator\",\"python jinja2 operator\",\"python join operator\",\"python json operators\",\"python key operator\",\"python kopf operator\",\"python kubernetes operator framework\",\"python like operator pandas\",\"python like statement mysql\",\"python list operations 1 hackerrank solution\",\"python list operations 2 hackerrank solution\",\"python modulo operator 0\",\"python not operator example\",\"python operations between lists\",\"python operations on strings\",\"python operations queue\",\"python operator 3 dots\",\"python operator airflow 1.10\",\"python operator airflow 2\",\"python operator always yields the result of\",\"python operator and not\",\"python operator binding\",\"python operator dag\",\"python operator div\",\"python operator example airflow\",\"python operator framework\",\"python operator get\",\"python operator getitem example\",\"python operator github\",\"python operator greater than\",\"python operator greater than or equal to\",\"python operator hat\",\"python operator javascript\",\"python operator jupyter\",\"python operator keyword\",\"python operator lambda\",\"python operator less than or equal to\",\"python operator like\",\"python operator like c\",\"python operator negation\",\"python operator norm\",\"python operator not\",\"python operator or boolean\",\"python operator or lambda\",\"python operator or list\",\"python operator or slash\",\"python operator overloading\",\"python operator overloading assignment\",\"python operator overloading different types\",\"python operator precedence examples\",\"python operator precedence order\",\"python operator question mark\",\"python operator range\",\"python operator reduce\",\"python operator remainder\",\"python operator responsible for declaring variables\",\"python operator retries\",\"python operator return value\",\"python operator ternary\",\"python operator tilde\",\"python operator truediv\",\"python operator unary\",\"python operator union\",\"python operator unzip\",\"python operator variable\",\"python operator venv\",\"python operator vertical line\",\"python operator vs\",\"python operator vs branchpythonoperator\",\"python operator vs expression\",\"python operator vs function\",\"python operator yield\",\"python operator zip\",\"python operators\",\"python operators airflow\",\"python operators and\",\"python operators and control flow statements\",\"python operators and control flow statements mcq\",\"python operators and expressions\",\"python operators and expressions with examples\",\"python operators and methods\",\"python operators and operands\",\"python operators and their meaning\",\"python operators arithmetic\",\"python operators as functions\",\"python operators associativity\",\"python operators between\",\"python operators bit\",\"python operators bitwise\",\"python operators boolean\",\"python operators by durga sir\",\"python operators cheat sheet\",\"python operators cheat sheet pdf\",\"python operators class\",\"python operators class 11\",\"python operators class 9\",\"python operators code\",\"python operators comparison\",\"python operators contains\",\"python operators definition\",\"python operators dictionary\",\"python operators different\",\"python operators division\",\"python operators documentation\",\"python operators equality\",\"python operators equivalent\",\"python operators example\",\"python operators example programs\",\"python operators exercises\",\"python operators explained\",\"python operators exponents\",\"python operators float\",\"python operators for class\",\"python operators for comparison\",\"python operators for strings\",\"python operators format\",\"python operators functions\",\"python operators geeksforgeeks\",\"python operators getattr\",\"python operators grouping\",\"python operators has the highest precedence\",\"python operators has the lowest precedence\",\"python operators hierarchy\",\"python operators if statement\",\"python operators import\",\"python operators in airflow\",\"python operators in class\",\"python operators in hindi\",\"python operators in java\",\"python operators in javatpoint\",\"python operators in python\",\"python operators interview questions\",\"python operators javatpoint\",\"python operators less than\",\"python operators library\",\"python operators list\",\"python operators list pdf\",\"python operators magic methods\",\"python operators math\",\"python operators mcq\",\"python operators meaning\",\"python operators module\",\"python operators multiplication\",\"python operators names\",\"python operators not equal\",\"python operators notes\",\"python operators numeric\",\"python operators on set\",\"python operators or\",\"python operators order\",\"python operators order of precedence\",\"python operators overloading\",\"python operators package\",\"python operators pdf\",\"python operators ppt\",\"python operators practice questions\",\"python operators precedence\",\"python operators programs\",\"python operators questions\",\"python operators questions and answers\",\"python operators redefine\",\"python operators set\",\"python operators shortcut\",\"python operators slideshare\",\"python operators split\",\"python operators string\",\"python operators symbols\",\"python operators syntax\",\"python operators table\",\"python operators that can be overloaded\",\"python operators tutorialspoint\",\"python operators types\",\"python operators unary and binary priorities and binding\",\"python operators w3schools\",\"python operators while\",\"python operators while loop\",\"python operators with example pdf\",\"python operators with examples\",\"python operators with numbers\",\"python operators with sets\",\"python operators worksheet\",\"python operators write\",\"python operators youtube\",\"python or operator\",\"python or operator in if\",\"python or operators\",\"python pipe operator like r\",\"python quaternary operator\",\"python query operators\",\"python quotient operator\",\"python star operator zip\",\"python string operations 1\",\"python string operations 1 hackerrank solution\",\"python string operations 2 hackerrank solution\",\"python unary operator if\",\"python unary operator overloading\",\"python what is operator overloading\",\"python xml operations\",\"python xnor operator\",\"python xor operator boolean\",\"python xor operator list\",\"python xor operator string\",\"python y operator\",\"using not operator in python\",\"using python operator\",\"what are logical operators in python\",\"what are operators in python\",\"what are python comparison operators\",\"what are python logical operators\",\"what are python operators\",\"what arithmetic operators cannot be used with strings in python\",\"what is membership operator in python\",\"what is operator in python\",\"what is operator overloading in python\",\"what is python operator in airflow\",\"what is python operator module\",\"where operator python\",\"which function overloads the operator in python\",\"which of the following is exponential operator in python\",\"which python operator has the highest precedence\",\"which python operator has the lowest precedence\",\"which python operator have higher precedence\",\"which python operator indicates integer division\",\"which python operator is responsible for declaring variables\",\"why python is used\",\"why python operator\",\"why use bitwise operators python\",\"with operator in python\",\"xor operator in python\"],\"articleSection\":[\"Python Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/\",\"name\":\"Logical Operators in Python with Examples: Comprehensive Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png\",\"datePublished\":\"2022-06-29T06:24:22+00:00\",\"dateModified\":\"2023-10-25T05:25:00+00:00\",\"description\":\"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png\",\"width\":1460,\"height\":900,\"caption\":\"Operators in Python with Examples - Types of Operators in Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/operators-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/itsourcecode.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Logical Operators in Python with Examples: Comprehensive Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/\",\"name\":\"Itsourcecode.com\",\"description\":\"Partner In Your Coding Journey!\",\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/itsourcecode.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\",\"name\":\"itsourcecode\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"width\":409,\"height\":409,\"caption\":\"itsourcecode\"},\"logo\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\"},\"description\":\"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!\",\"sameAs\":[\"https:\\\/\\\/itsourcecode.com\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\",\"name\":\"Prince Ly Cesar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"caption\":\"Prince Ly Cesar\"},\"description\":\"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode\",\"sameAs\":[\"https:\\\/\\\/activadorkeys.com\\\/\",\"www.facebook.com\\\/unguardable7\",\"http:\\\/\\\/www.instagram.com\\\/prnclycsr\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/www.twitter.com\\\/unguardable0729\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber\"],\"gender\":\"male\",\"knowsAbout\":[\"Graphic Designing\"],\"knowsLanguage\":[\"English\",\"Tagalog\"],\"jobTitle\":\"Graphic Designer\",\"worksFor\":\"IT SourceCode\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/author\\\/unguardable\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Logical Operators in Python with Examples: Comprehensive Guide","description":"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Logical Operators in Python with Examples: Comprehensive Guide","og_description":"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.","og_url":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/","og_site_name":"Itsourcecode.com","article_author":"www.facebook.com\/unguardable7","article_published_time":"2022-06-29T06:24:22+00:00","article_modified_time":"2023-10-25T05:25:00+00:00","og_image":[{"width":1460,"height":900,"url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png","type":"image\/png"}],"author":"Prince Ly Cesar","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/www.twitter.com\/unguardable0729","twitter_misc":{"Written by":"Prince Ly Cesar","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#article","isPartOf":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/"},"author":{"name":"Prince Ly Cesar","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b"},"headline":"Logical Operators in Python with Examples: Comprehensive Guide","datePublished":"2022-06-29T06:24:22+00:00","dateModified":"2023-10-25T05:25:00+00:00","mainEntityOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/"},"wordCount":1108,"commentCount":0,"publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png","keywords":["4 python operators","airflow with python operator","and operator python if statement","conditional operator in python","different python operator","do operator python","does python have operator","how does python in operator work","how does python operator work","how many membership operator in python","how many operators are there in python","how many operators are used in python","how many types of operators used in python","how much python developer earn in india","how much python is required for job","how to use and operator in python","if python or operator","in python operators","is operator in python","is operator python","is operator python 3","is python operator","modulo operator in python","modulus operator in python","near by python course","near operator example","near python institute","operators in python geeksforgeeks","order of python operators","python 2 operator itemgetter","python 2 operator precedence","python 2 operators","python 2.7 operator overloading","python 2.7 operators","python 3 operator lt","python 3 operator module","python 3 operator overloading","python 3 operators","python 3.8 operators","python 3.9 operators","python 991 owners manual","python and operator","python and operator example","python arithmetic operators","python arithmetic operators questions","python assignment operator","python assignment operators explained","python bitwise operators in 16 bit","python boolean operators youtube","python equal operator","python has operator","python hash operator","python heap operations","python hex operations","python how many operators","python in operator dictionary","python in operator list","python in operator overloading","python in operator string","python in operator time complexity","python is operator boolean","python is operator example","python is operator int","python is operator not working","python is operator overloading","python is operator precedence","python is operator strings","python j operator","python jinja2 operator","python join operator","python json operators","python key operator","python kopf operator","python kubernetes operator framework","python like operator pandas","python like statement mysql","python list operations 1 hackerrank solution","python list operations 2 hackerrank solution","python modulo operator 0","python not operator example","python operations between lists","python operations on strings","python operations queue","python operator 3 dots","python operator airflow 1.10","python operator airflow 2","python operator always yields the result of","python operator and not","python operator binding","python operator dag","python operator div","python operator example airflow","python operator framework","python operator get","python operator getitem example","python operator github","python operator greater than","python operator greater than or equal to","python operator hat","python operator javascript","python operator jupyter","python operator keyword","python operator lambda","python operator less than or equal to","python operator like","python operator like c","python operator negation","python operator norm","python operator not","python operator or boolean","python operator or lambda","python operator or list","python operator or slash","python operator overloading","python operator overloading assignment","python operator overloading different types","python operator precedence examples","python operator precedence order","python operator question mark","python operator range","python operator reduce","python operator remainder","python operator responsible for declaring variables","python operator retries","python operator return value","python operator ternary","python operator tilde","python operator truediv","python operator unary","python operator union","python operator unzip","python operator variable","python operator venv","python operator vertical line","python operator vs","python operator vs branchpythonoperator","python operator vs expression","python operator vs function","python operator yield","python operator zip","python operators","python operators airflow","python operators and","python operators and control flow statements","python operators and control flow statements mcq","python operators and expressions","python operators and expressions with examples","python operators and methods","python operators and operands","python operators and their meaning","python operators arithmetic","python operators as functions","python operators associativity","python operators between","python operators bit","python operators bitwise","python operators boolean","python operators by durga sir","python operators cheat sheet","python operators cheat sheet pdf","python operators class","python operators class 11","python operators class 9","python operators code","python operators comparison","python operators contains","python operators definition","python operators dictionary","python operators different","python operators division","python operators documentation","python operators equality","python operators equivalent","python operators example","python operators example programs","python operators exercises","python operators explained","python operators exponents","python operators float","python operators for class","python operators for comparison","python operators for strings","python operators format","python operators functions","python operators geeksforgeeks","python operators getattr","python operators grouping","python operators has the highest precedence","python operators has the lowest precedence","python operators hierarchy","python operators if statement","python operators import","python operators in airflow","python operators in class","python operators in hindi","python operators in java","python operators in javatpoint","python operators in python","python operators interview questions","python operators javatpoint","python operators less than","python operators library","python operators list","python operators list pdf","python operators magic methods","python operators math","python operators mcq","python operators meaning","python operators module","python operators multiplication","python operators names","python operators not equal","python operators notes","python operators numeric","python operators on set","python operators or","python operators order","python operators order of precedence","python operators overloading","python operators package","python operators pdf","python operators ppt","python operators practice questions","python operators precedence","python operators programs","python operators questions","python operators questions and answers","python operators redefine","python operators set","python operators shortcut","python operators slideshare","python operators split","python operators string","python operators symbols","python operators syntax","python operators table","python operators that can be overloaded","python operators tutorialspoint","python operators types","python operators unary and binary priorities and binding","python operators w3schools","python operators while","python operators while loop","python operators with example pdf","python operators with examples","python operators with numbers","python operators with sets","python operators worksheet","python operators write","python operators youtube","python or operator","python or operator in if","python or operators","python pipe operator like r","python quaternary operator","python query operators","python quotient operator","python star operator zip","python string operations 1","python string operations 1 hackerrank solution","python string operations 2 hackerrank solution","python unary operator if","python unary operator overloading","python what is operator overloading","python xml operations","python xnor operator","python xor operator boolean","python xor operator list","python xor operator string","python y operator","using not operator in python","using python operator","what are logical operators in python","what are operators in python","what are python comparison operators","what are python logical operators","what are python operators","what arithmetic operators cannot be used with strings in python","what is membership operator in python","what is operator in python","what is operator overloading in python","what is python operator in airflow","what is python operator module","where operator python","which function overloads the operator in python","which of the following is exponential operator in python","which python operator has the highest precedence","which python operator has the lowest precedence","which python operator have higher precedence","which python operator indicates integer division","which python operator is responsible for declaring variables","why python is used","why python operator","why use bitwise operators python","with operator in python","xor operator in python"],"articleSection":["Python Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/","url":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/","name":"Logical Operators in Python with Examples: Comprehensive Guide","isPartOf":{"@id":"https:\/\/itsourcecode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#primaryimage"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png","datePublished":"2022-06-29T06:24:22+00:00","dateModified":"2023-10-25T05:25:00+00:00","description":"This tutorial is about operators in Python with examples. Learn how to use different types of Python Operators with simple and easy examples.","breadcrumb":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#primaryimage","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/06\/Operators-in-Python-with-Examples-Types-of-Operators-in-Python.png","width":1460,"height":900,"caption":"Operators in Python with Examples - Types of Operators in Python"},{"@type":"BreadcrumbList","@id":"https:\/\/itsourcecode.com\/python-tutorial\/operators-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsourcecode.com\/"},{"@type":"ListItem","position":2,"name":"Logical Operators in Python with Examples: Comprehensive Guide"}]},{"@type":"WebSite","@id":"https:\/\/itsourcecode.com\/#website","url":"https:\/\/itsourcecode.com\/","name":"Itsourcecode.com","description":"Partner In Your Coding Journey!","publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsourcecode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc","name":"itsourcecode","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","width":409,"height":409,"caption":"itsourcecode"},"logo":{"@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg"},"description":"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!","sameAs":["https:\/\/itsourcecode.com\/"]},{"@type":"Person","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b","name":"Prince Ly Cesar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","url":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","caption":"Prince Ly Cesar"},"description":"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode","sameAs":["https:\/\/activadorkeys.com\/","www.facebook.com\/unguardable7","http:\/\/www.instagram.com\/prnclycsr\/","https:\/\/x.com\/http:\/\/www.twitter.com\/unguardable0729","https:\/\/www.youtube.com\/channel\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber"],"gender":"male","knowsAbout":["Graphic Designing"],"knowsLanguage":["English","Tagalog"],"jobTitle":"Graphic Designer","worksFor":"IT SourceCode","url":"https:\/\/itsourcecode.com\/author\/unguardable\/"}]}},"_links":{"self":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/65241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/users\/1373"}],"replies":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/comments?post=65241"}],"version-history":[{"count":25,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/65241\/revisions"}],"predecessor-version":[{"id":119296,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/65241\/revisions\/119296"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media\/66395"}],"wp:attachment":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media?parent=65241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/categories?post=65241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/tags?post=65241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}