{"id":25526708,"date":"2022-06-04T20:35:14","date_gmt":"2022-06-04T15:05:14","guid":{"rendered":"https:\/\/entri.app\/blog\/?p=25526708"},"modified":"2022-11-22T17:04:44","modified_gmt":"2022-11-22T11:34:44","slug":"what-are-the-different-types-of-operators-in-python","status":"publish","type":"post","link":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/","title":{"rendered":"What are the different types of operators in Python"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ea8f91a9a5c\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ea8f91a9a5c\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#Python_Operators\" >Python Operators<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#Assignment_Operators_in_Python\" >Assignment Operators in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#Python_Relational_Operators\" >Python Relational Operators<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#Python_Arithmetic_Operators\" >Python Arithmetic Operators<\/a><\/li><\/ul><\/nav><\/div>\n<p>Constructs in Python programming language that instruct the interpreter to perform a certain function involving two or more variables upon which the construct operates are called python operators. Though not actually seen as functions, they have their own identity as concepts because they are different syntactically and semantically from functions. It performs tasks of various nature, including arithmetic, bitwise, membership, identity, comparison, assignment, and logic, etc., with a certain order of execution existing among them.<a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-25522670 size-full\" src=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-1.png\" alt=\"Python and Machine Learning Rectangle\" width=\"970\" height=\"250\" srcset=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-1.png 970w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-1-300x77.png 300w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-1-768x198.png 768w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-1-750x193.png 750w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Python_Operators\"><\/span><strong>Python Operators<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Operators in python are constructs in Python that instruct the interpreter to perform a certain function; however, these are traditionally not defined as functions; rather, they are syntactically and semantically different from functions. Operators are used to performing operations on variables and values according to their use.<\/p>\n<p>Python language supports the following types of operators.<\/p>\n<ol>\n<li>Arithmetic Operators<\/li>\n<li>Bitwise Operators<\/li>\n<li>Membership Operators<\/li>\n<li>Identity Operators<\/li>\n<li>Comparison Operators<\/li>\n<li>Assignment Operators<\/li>\n<li>Logical Operators<\/li>\n<\/ol>\n<h3><strong>1. Arithmetic Operator<\/strong><\/h3>\n<p>Arithmetic operators are used to performing mathematical operations<\/p>\n<div>\n<table width=\"688\">\n<tbody>\n<tr>\n<td width=\"97\"><strong>Operator<\/strong><\/td>\n<td width=\"174\"><strong>Description<\/strong><\/td>\n<td width=\"157\"><strong>Syntax<\/strong><\/td>\n<td width=\"260\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"97\">+<\/td>\n<td width=\"174\">Addition<\/td>\n<td width=\"157\">a+b<\/td>\n<td width=\"260\">Returns sum of the operands<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">\u2013<\/td>\n<td width=\"174\">Subtraction<\/td>\n<td width=\"157\">a-b<\/td>\n<td width=\"260\">Returns Difference of the operands<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">\/<\/td>\n<td width=\"174\">Division<\/td>\n<td width=\"157\">a\/b<\/td>\n<td width=\"260\">Returns Quotient of the operands<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">*<\/td>\n<td width=\"174\">Multiplication<\/td>\n<td width=\"157\">a*b<\/td>\n<td width=\"260\">Returns product of the operands<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">**<\/td>\n<td width=\"174\">Exponentiation<\/td>\n<td width=\"157\">a**b<\/td>\n<td width=\"260\">returns exponent of a raised to the power b<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">%<\/td>\n<td width=\"174\">Modulus<\/td>\n<td width=\"157\">a%b<\/td>\n<td width=\"260\">returns remainder of the division<\/td>\n<\/tr>\n<tr>\n<td width=\"97\">\/\/<\/td>\n<td width=\"174\">Floor division<\/td>\n<td width=\"157\">a\/\/b<\/td>\n<td width=\"260\">returns a real value and ignores the decimal part<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Let us consider an example program for carrying out the arithmetic operations explained above.<\/p>\n<p>Let us consider two integers Xa=2 and Xb=3<\/p>\n<p><strong>Program<\/strong><\/p>\n<p><code>Xa = int(input('Enter First number: '))<br \/>\nXb = int(input('Enter Second number: '))<br \/>\nadd = Xa + Xb<br \/>\ndiff = Xa - Xb<br \/>\nmul = Xa * Xb<br \/>\ndiv = Xa \/ Xb<br \/>\nfloor_div = Xa \/\/ Xb<br \/>\npower = Xa ** Xb<br \/>\nmodulus = Xa % Xb<br \/>\nprint('Sum of the numbers is',Xa ,'and' ,Xb ,'is :',add)<br \/>\nprint('Difference of the numbers is ',Xa ,'and' ,Xb ,'is :',diff)<br \/>\nprint('Product of the numbers is ' ,Xa ,'and' ,Xb ,'is :',mul)<br \/>\nprint('Division of the numbers is ',Xa ,'and' ,Xb ,'is :',div)<br \/>\nprint('Floor Division of the numbers is ',Xa ,'and' ,Xb ,'is :',floor_div)<br \/>\nprint('Exponent of the numbers is ',Xa ,'and' ,Xb ,'is :',power)<br \/>\nprint('Modulus of the numbers is ',Xa ,'and' ,Xb ,'is :',modulus)<\/code><\/p>\n<p><strong>Output<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-142459 lazyloaded\" src=\"https:\/\/cdn.educba.com\/academy\/wp-content\/uploads\/2019\/02\/o1.png\" srcset=\"https:\/\/cdn.educba.com\/academy\/wp-content\/uploads\/2019\/02\/o1.png 961w, https:\/\/cdn.educba.com\/academy\/wp-content\/uploads\/2019\/02\/o1-300x159.png 300w, https:\/\/cdn.educba.com\/academy\/wp-content\/uploads\/2019\/02\/o1-768x406.png 768w\" alt=\"o1\" width=\"961\" height=\"508\" data-ll-status=\"loaded\" \/><\/p>\n<h3><strong>2. Bitwise Operators<\/strong><\/h3>\n<p>Refers to the operators working on a bit, i.e. they treat the operand as a string of bits; for example, in bitwise operations, 5 will be considered as 0101.<\/p>\n<p>The box below provides the bitwise operators in python<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"105\"><strong>Operator<\/strong><\/td>\n<td width=\"189\"><strong>Description<\/strong><\/td>\n<td width=\"171\"><strong>Syntax<\/strong><\/td>\n<td width=\"564\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"105\">&amp;<\/td>\n<td width=\"189\">Binary AND<\/td>\n<td width=\"171\">a&amp;b<\/td>\n<td width=\"564\">copies a bit to the result if it exists in both operands<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">|<\/td>\n<td width=\"189\">Binary OR<\/td>\n<td width=\"171\">a|b<\/td>\n<td width=\"564\">copies a bit if it exists in either operand.<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">^<\/td>\n<td width=\"189\">Binary XOR<\/td>\n<td width=\"171\">a^b<\/td>\n<td width=\"564\">copies the bit if it is set in one operand but not both.<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">~<\/td>\n<td width=\"189\">Binary One\u2019s Complement<\/td>\n<td width=\"171\">a~b<\/td>\n<td width=\"564\">Unary operation of flipping bits<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">&lt;&lt;<\/td>\n<td width=\"189\">Binary Left Shift<\/td>\n<td width=\"171\">a&lt;&lt;b<\/td>\n<td width=\"564\">The left operands value is moved left by the number of bits specified by the right operand.<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">&gt;&gt;<\/td>\n<td width=\"189\">Binary Right Shift<\/td>\n<td width=\"171\">a&gt;&gt;b<\/td>\n<td width=\"564\">left operands value is moved right by the number of bits specified by the right operand.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>3. Membership Operators<\/strong><\/h3>\n<p>Refers to the operators used in the validation of membership of operand test in a sequence, such as strings, lists, or tuples. There are two types of membership operators in python.<\/p>\n<div class=\"code-block code-block-17\">\n<div id=\"banner_1\" class=\"five-sixths box-div\">\n<div class=\"five-sixths\">\n<div class=\"two-sixths price-box\"><\/div>\n<\/div>\n<hr \/>\n<\/div>\n<div><\/div>\n<\/div>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"84\"><strong>Operator<\/strong><\/td>\n<td width=\"122\"><strong>Syntax<\/strong><\/td>\n<td width=\"418\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"84\">in<\/td>\n<td width=\"122\">if (a in x):<\/td>\n<td width=\"418\">Evaluates to true if it finds a variable in the specified sequence and false otherwise.<\/td>\n<\/tr>\n<tr>\n<td width=\"84\">not in<\/td>\n<td width=\"122\">If ( b not in x ):<\/td>\n<td width=\"418\">Evaluates to true if it does not finds a variable in the specified sequence and false otherwise.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>4. Identity Operators<\/strong><\/h3>\n<p>Used to compare the operands\u2019 memory locations, they are quite often used to determine if the operand is of a particular type; there are two types of\u00a0identity operators in python.<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"49\"><strong>Operator<\/strong><\/td>\n<td width=\"172\"><strong>Syntax<\/strong><\/td>\n<td width=\"402\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"49\">is<\/td>\n<td width=\"172\">x is y<\/td>\n<td width=\"402\">returns True if the type of the value in y points to the same type in the x.<\/td>\n<\/tr>\n<tr>\n<td width=\"49\">is not<\/td>\n<td width=\"172\">x is not y<\/td>\n<td width=\"402\">returns\u00a0True\u00a0if the type of the value in y points to a different type than the value in the x<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>5. Comparison Operators<\/strong><\/h3>\n<p>Also known as Relational operators, these operators are used in determining the relation between the operand on either side of the operator.<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"38\"><strong>Operator<\/strong><\/td>\n<td width=\"194\"><strong>Syntax<\/strong><\/td>\n<td width=\"391\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"38\">==<\/td>\n<td width=\"194\">(a == b)<\/td>\n<td width=\"391\">If the values of a and b are equal, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">!=<\/td>\n<td width=\"194\">(a != b)<\/td>\n<td width=\"391\">If values of a and b are not equal, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">&lt;&gt;<\/td>\n<td width=\"194\">(a &lt;&gt; b)<\/td>\n<td width=\"391\">If values of a and b are not equal, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">&gt;<\/td>\n<td width=\"194\">(a &gt; b)<\/td>\n<td width=\"391\">If the value of a is greater than the value of b, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">&lt;<\/td>\n<td width=\"194\">(a &lt; b)<\/td>\n<td width=\"391\">If the value of a is less than the value of b, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">&gt;=<\/td>\n<td width=\"194\">(a &gt;= b)<\/td>\n<td width=\"391\">If the value of a is greater than or equal to the value of b, then the condition becomes true.<\/td>\n<\/tr>\n<tr>\n<td width=\"38\">&lt;=<\/td>\n<td width=\"194\">(a &lt;= b)<\/td>\n<td width=\"391\">If the value of b is less than or equal to the value of b, then the condition becomes true.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>6. Assignment Operators<\/strong><\/h3>\n<p>Referred as the name suggests, it is used to declare assignments to the operands; the following are the types of\u00a0assignment operators in python.<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"64\"><strong>Operator<\/strong><\/td>\n<td width=\"64\"><strong>Description<\/strong><\/td>\n<td width=\"57\"><strong>Syntax<\/strong><\/td>\n<td width=\"337\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"64\">=<\/td>\n<td width=\"64\">Equal to<\/td>\n<td width=\"57\">c = a + b<\/td>\n<td width=\"337\">assigns a value of a + b into c<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">+=<\/td>\n<td width=\"64\">Add AND<\/td>\n<td width=\"57\">c += a<\/td>\n<td width=\"337\">is equivalent to c = c + a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">-=<\/td>\n<td width=\"64\">Subtract AND<\/td>\n<td width=\"57\">c -= a<\/td>\n<td width=\"337\">is equivalent to c = c \u2013 a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">*=<\/td>\n<td width=\"64\">Multiply AND<\/td>\n<td width=\"57\">c *= a<\/td>\n<td width=\"337\">is equivalent to c = c * a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">\/=<\/td>\n<td width=\"64\">Divide AND<\/td>\n<td width=\"57\">c \/= a<\/td>\n<td width=\"337\">is equivalent to c = c \/ ac \/= a is equivalent to c = c \/ a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">%=<\/td>\n<td width=\"64\">Modulus AND<\/td>\n<td width=\"57\">c %= a<\/td>\n<td width=\"337\">is equivalent to c = c % a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">**=<\/td>\n<td width=\"64\">Exponent AND<\/td>\n<td width=\"57\">c **= a<\/td>\n<td width=\"337\">is equivalent to c = c ** a<\/td>\n<\/tr>\n<tr>\n<td width=\"64\">\/\/=<\/td>\n<td width=\"64\">Floor Division<\/td>\n<td width=\"57\">c \/\/= a<\/td>\n<td width=\"337\">is equivalent to c = c \/\/ a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><strong>7. Logical Operators<\/strong><\/h3>\n<p>These operators are used to perform similar operations as that of logical gates; there are 3 types of logical operators in python.<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td width=\"105\"><strong>Operator<\/strong><\/td>\n<td width=\"204\"><strong>Description<\/strong><\/td>\n<td width=\"171\"><strong>Syntax<\/strong><\/td>\n<td width=\"564\"><strong>Output<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"105\">and<\/td>\n<td width=\"204\">Logical AND<\/td>\n<td width=\"171\">a and b<\/td>\n<td width=\"564\">a condition is true if both a and b are true<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">or<\/td>\n<td width=\"204\">Logical OR<\/td>\n<td width=\"171\">a or b<\/td>\n<td width=\"564\">a condition is true if either a and b are true<\/td>\n<\/tr>\n<tr>\n<td width=\"105\">not<\/td>\n<td width=\"204\">Logical NOT<\/td>\n<td width=\"171\">not a<\/td>\n<td width=\"564\">Complement the operand<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Python Operators are the backbone of any operations and functions in the programming context.<\/p>\n<p style=\"text-align: center;\"><strong><a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\">Grab the opportunity to learn Python with Entri! Click Here<\/a><\/strong><\/p>\n<div>\n<div class=\"article-title\">\n<h2><span class=\"ez-toc-section\" id=\"Assignment_Operators_in_Python\"><\/span><strong>Assignment Operators in Python<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<\/div>\n<\/div>\n<div class=\"text\">\n<p>Operators are used to perform operations on values and variables. These are the special symbols that carry out arithmetic, logical, bitwise computations. The value the operator operates on is known as\u00a0Operand.<\/p>\n<p>Here, we will cover\u00a0Assignment Operators\u00a0in Python. So,\u00a0Assignment Operators\u00a0are used to assigning values to variables.<\/p>\n<figure class=\"table\">\n<table>\n<thead>\n<tr>\n<th><strong>Operator<\/strong><\/th>\n<th><strong>Description<\/strong><\/p>\n<div id=\"GFG_AD_gfg_mobile_336x280\"><\/div>\n<\/th>\n<th><strong>Syntax<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>=<\/td>\n<td>Assign value of right side of expression to left side operand<\/td>\n<td>x = y + z<\/td>\n<\/tr>\n<tr>\n<td>+=<\/td>\n<td>Add and Assign: Add right side operand with left side operand and then assign to left operand<\/td>\n<td>a += b<\/td>\n<\/tr>\n<tr>\n<td>-=<\/td>\n<td>Subtract AND: Subtract right operand from left operand and then assign to left operand: True if both operands are equal<\/td>\n<td>a -= b<\/td>\n<\/tr>\n<tr>\n<td>*=<\/td>\n<td>Multiply AND: Multiply right operand with left operand and then assign to left operand<\/td>\n<td>a *= b<\/td>\n<\/tr>\n<tr>\n<td>\/=<\/td>\n<td>Divide AND: Divide left operand with right operand and then assign to left operand<\/td>\n<td>a \/= b<\/td>\n<\/tr>\n<tr>\n<td>%=<\/td>\n<td>Modulus AND: Takes modulus using left and right operands and assign result to left operand<\/td>\n<td>a %= b<\/td>\n<\/tr>\n<tr>\n<td>\/\/=<\/td>\n<td>Divide(floor) AND: Divide left operand with right operand and then assign the value(floor) to left operand<\/td>\n<td>a \/\/= b<\/td>\n<\/tr>\n<tr>\n<td>**=<\/td>\n<td>Exponent AND: Calculate exponent(raise power) value using operands and assign value to left operand<\/td>\n<td>a **= b<\/td>\n<\/tr>\n<tr>\n<td>&amp;=<\/td>\n<td>Performs Bitwise AND on operands and assign value to left operand<\/td>\n<td>a &amp;= b<\/td>\n<\/tr>\n<tr>\n<td>|=<\/td>\n<td>Performs Bitwise OR on operands and assign value to left operand<\/td>\n<td>a |= b<\/td>\n<\/tr>\n<tr>\n<td>^=<\/td>\n<td>Performs Bitwise xOR on operands and assign value to left operand<\/td>\n<td>a ^= b<\/td>\n<\/tr>\n<tr>\n<td>&gt;&gt;=<\/td>\n<td>Performs Bitwise right shift on operands and assign value to left operand<\/td>\n<td>a &gt;&gt;= b<\/td>\n<\/tr>\n<tr>\n<td>&lt;&lt;=<\/td>\n<td>Performs Bitwise left shift on operands and assign value to left operand<\/td>\n<td>a &lt;&lt;= b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Now Let\u2019s see each Assignment Operator one by one.<\/p>\n<p><strong>1) Assign:<\/strong>\u00a0This operator is used to assign the value of the right side of the expression to the left side operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x = y + z\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist1-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist1-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist1-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_461280\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"comments\"># Assigning values using\u00a0<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"comments\"># Assignment Operator<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"plain\">c <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">a <\/code><code class=\"keyword\">+<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(c)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>8\r\n<\/pre>\n<p><strong>2) Add and Assign:<\/strong>\u00a0This operator is used to add the right side operand with the left side operand and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre>x += y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist2-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist2-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist2-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_975801\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a + b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">+<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>8\r\n<\/pre>\n<p><strong>3)<\/strong>\u00a0<strong>Subtract and Assign:\u00a0<\/strong>This operator is used to subtract the right operand from the left operand and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x -= y<\/pre>\n<p><strong>Example \u2013<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist3-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist3-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist3-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\">\n<div class=\"editor-buttons-div\" title=\"Run and Edit\">\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_233859\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a - b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">-<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>-2\r\n<\/pre>\n<p><strong>\u00a04)<\/strong>\u00a0<strong>Multiply and Assign:<\/strong>\u00a0This operator is used to multiply the right operand with the left operand and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x *= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist4-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist4-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist4-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\">\n<div class=\"editor-buttons-div\" title=\"Run and Edit\">\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_79530\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a * b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">*<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>15\r\n<\/pre>\n<p><strong>\u00a05)<\/strong>\u00a0<strong>Divide and Assign:<\/strong>\u00a0This operator is used to divide the left operand with the right operand and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:\u00a0<\/strong><\/p>\n<pre>x \/= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist5-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist5-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist5-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\">\n<div class=\"editor-buttons-div\" title=\"Run and Edit\">\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_456231\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a \/ b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">\/<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>0.6\r\n<\/pre>\n<p><strong>\u00a06) Modulus and Assign:<\/strong>\u00a0This operator is used to take the modulus using the left and the right operands and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x %= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist6-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist6-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist6-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_904513\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a % b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">%<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>3\r\n<\/pre>\n<p><strong>7) Divide (floor) and Assign:<\/strong>\u00a0This operator is used to divide the left operand with the right operand and then assigning the result(floor) to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x \/\/= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist7-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python<\/li>\n<\/ul>\n<div id=\"tablist7-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist7-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_333806\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a \/\/ b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">\/<\/code><code class=\"keyword\">\/<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>0\r\n<\/pre>\n<p><strong>\u00a08)<\/strong>\u00a0<strong>Exponent and Assign:\u00a0<\/strong>This operator is used to calculate the exponent(raise power) value using operands and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x **= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist8-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python<\/li>\n<\/ul>\n<div id=\"tablist8-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist8-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_687834\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a ** b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">*<\/code><code class=\"keyword\">*<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>243\r\n<\/pre>\n<p><strong>9) Bitwise AND and Assign:<\/strong>\u00a0This operator is used to perform Bitwise AND on both operands and then assigning the result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x &amp;= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist9-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist9-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist9-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_29708\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a &amp; b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a &amp;<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>1\r\n<\/pre>\n<p><strong>10) Bitwise OR and Assign:\u00a0<\/strong>This operator is used to perform Bitwise OR on the operands and then assigning result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x |= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist10-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist10-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist10-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_890178\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a | b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a |<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>7\r\n<\/pre>\n<p><strong>11)<\/strong>\u00a0<strong>Bitwise XOR and Assign:\u00a0<\/strong>This operator is used to perform Bitwise XOR on the operands and then assigning result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x ^= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist11-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist11-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist11-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_291942\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a ^ b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a ^<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>6\r\n<\/pre>\n<p><strong>12)<\/strong>\u00a0<strong>Bitwise Right Shift and Assign:\u00a0<\/strong>This operator is used to perform Bitwise right shift on the operands and then assigning result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x &gt;&gt;= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist12-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist12-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist12-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_514915\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a &gt;&gt; b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a &gt;&gt;<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>0\r\n<\/pre>\n<p><strong>\u00a013)<\/strong>\u00a0<strong>Bitwise Left Shift and Assign:\u00a0<\/strong>This operator is used to perform Bitwise left shift on the operands and then assigning result to the left operand.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre>x &lt;&lt;= y\r\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<div class=\"responsive-tabs-wrapper\">\n<div class=\"responsive-tabs responsive-tabs--enabled\">\n<ul class=\"responsive-tabs__list\" role=\"tablist\">\n<li id=\"tablist13-tab1\" class=\"responsive-tabs__list__item responsive-tabs__list__item--active\" role=\"tab\">Python3<\/li>\n<\/ul>\n<div id=\"tablist13-panel1\" class=\"tabcontent responsive-tabs__panel responsive-tabs__panel--active\" role=\"tabpanel\" aria-hidden=\"false\" aria-labelledby=\"tablist13-tab1\">\n<div class=\"code-block\">\n<div class=\"code-gutter\">\n<div class=\"editor-buttons-container\">\n<div class=\"editor-buttons\"><\/div>\n<\/div>\n<\/div>\n<div class=\"code-container\">\n<div id=\"highlighter_580182\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">a <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">b <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">5<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># a = a &lt;&lt; b<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">a &lt;&lt;<\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">b<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"comments\"># Output<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(a)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output:<\/strong><\/p>\n<pre>96\r\n\r\n<\/pre>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\"><strong>Learn to code from industry experts! Enroll here<\/strong><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Python_Relational_Operators\"><\/span><strong>Python Relational Operators<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A relational operator is used to compare two values. Based on the operator and values, the operator returns either True or False.<\/p>\n<p>In Python, there are six Relational Operators. They are<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<thead>\n<tr>\n<th>Symbol<\/th>\n<th>Name<\/th>\n<th>Example<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>==<\/td>\n<td>Equal to<\/td>\n<td>x == y<\/td>\n<td>Returns True if x and y have same value, else returns False.<\/td>\n<\/tr>\n<tr>\n<td>&gt;<\/td>\n<td>Greater than<\/td>\n<td>x &gt; y<\/td>\n<td>Returns True if value of x is greater than value of y, else returns False.<\/td>\n<\/tr>\n<tr>\n<td>&lt;<\/td>\n<td>Less than<\/td>\n<td>x &lt; y<\/td>\n<td>Returns True if value of x is less than value of y, else returns False.<\/td>\n<\/tr>\n<tr>\n<td>!=<\/td>\n<td>Not equal to<\/td>\n<td>x != y<\/td>\n<td>Returns True if x and y do not have same value, else returns False.<\/td>\n<\/tr>\n<tr>\n<td>&gt;=<\/td>\n<td>Greater than or equal to<\/td>\n<td>x &gt;= y<\/td>\n<td>Returns True if value of x is greater than or equal to value of y, else returns False. Equivalent to ( x&gt;y or x==y )<\/td>\n<\/tr>\n<tr>\n<td>&lt;=<\/td>\n<td>Less than or equal to<\/td>\n<td>x &lt;= y<\/td>\n<td>Returns True if value of x is less than or equal to value of y, else returns False. Equivalent to ( x&gt;y or x==y )<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3>Equal to Operator<\/h3>\n<p>Equal to operator\u00a0<code class=\" language-python\"><span class=\"token operator\">==<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if both the operands are equal in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such than both are equal in value, and check the result of equal to operator with these two integers provided as operands to the equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">41<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">41<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">==<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such than both are not equal in value, and check the result of equal to operator with these two integers provided as operands to the equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">41<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">==<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<div id=\"bsa-zone_1594660483555-1_123456\" class=\"center\" data-google-query-id=\"CJOXjeWij_gCFY-BUQode9UIzA\">\n<div id=\"google_ads_iframe_\/8691100\/PythonExamples_S2S_InContent_ROS_Pos1_0__container__\"><\/div>\n<\/div>\n<h3>Greater than Operator<\/h3>\n<p>Greater than operator\u00a0<code class=\" language-python\"><span class=\"token operator\">&gt;<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if the left operand is greater than the right operand in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such that left operand is greater than the right operand, and check the result of greater than operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">87<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&gt;<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such that left operand is less than the right operand, and check the result of greater than operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">41<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&gt;<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<h3>Less than Operator<\/h3>\n<p>Less than operator\u00a0<code class=\" language-python\"><span class=\"token operator\">&lt;<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if the left operand is less than the right operand in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such that left operand is less than the right operand, and check the result of less than operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">41<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&lt;<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such that left operand is greater than the right operand, and check the result of less than operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">92<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&lt;<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<h3>Not Equal to Operator<\/h3>\n<p>Not Equal to operator\u00a0<code class=\" language-python\"><span class=\"token operator\">!=<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if both the operands are not equal in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such that both are not equal in value, and check the result of not equal to operator with these two integers provided as operands to the not equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">92<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">!=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such that both are equal in value, and check the result of not equal to operator with these two integers provided as operands to the not equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">!=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<h3>Greater than or Equal to Operator<\/h3>\n<p>Greater than or Equal to operator\u00a0<code class=\" language-python\"><span class=\"token operator\">&gt;=<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if the left operand is greater than or equal to the right operand in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such that left operand is greater than or equal to the right operand, and check the result of greater than or equal to operator.<\/p>\n<p style=\"text-align: center;\"><strong><a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\">Learn Coding in your Language! Enroll Here!<\/a><\/strong><\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">97<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&gt;=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such that left operand is less than the right operand, and check the result of greater than or equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">42<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&gt;=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<h3>Less than or Equal to Operator<\/h3>\n<p>Less than or Equal to operator\u00a0<code class=\" language-python\"><span class=\"token operator\">&lt;=<\/span><\/code>\u00a0takes two operands and returns boolean value of True, if the left operand is less than or equal to the right operand in value, else it returns False.<\/p>\n<p>In the following example, we will take two integer values such that left operand is less than the right operand, and check the result of less than or equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">42<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&lt;=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">True<\/span><\/code><\/pre>\n<p>In the following example, we will take two integer values such that left operand is greater than the right operand, and check the result of less than or equal to operator.<\/p>\n<p><strong>Python Program<\/strong><\/p>\n<pre class=\"wp-block-code language-python\"><code class=\" language-python\">x <span class=\"token operator\">=<\/span> <span class=\"token number\">92<\/span>\r\ny <span class=\"token operator\">=<\/span> <span class=\"token number\">63<\/span>\r\nresult <span class=\"token operator\">=<\/span> x <span class=\"token operator\">&lt;=<\/span> y\r\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>result<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<pre>\u00a0Run<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre class=\"wp-block-code output language-python\"><code class=\" language-python\"><span class=\"token boolean\">False<\/span><\/code><\/pre>\n<div>\n<div class=\"article-title\">\n<h2><span class=\"ez-toc-section\" id=\"Python_Arithmetic_Operators\"><\/span><strong>Python Arithmetic Operators<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-25520910 size-full\" src=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square.png\" alt=\"Python and Machine Learning Square\" width=\"345\" height=\"345\" srcset=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square.png 345w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-300x300.png 300w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-150x150.png 150w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-24x24.png 24w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-48x48.png 48w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-96x96.png 96w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Square-75x75.png 75w\" sizes=\"auto, (max-width: 345px) 100vw, 345px\" \/><\/a><\/p>\n<\/div>\n<div class=\"article-buttons\">\n<div class=\"article--viewer_like tooltip\"><\/div>\n<\/div>\n<\/div>\n<div class=\"text\">\n<p><strong>Arithmetic operators<\/strong>\u00a0are used to perform mathematical operations like addition, subtraction, multiplication and division.<\/p>\n<p>There are 7 arithmetic operators in Python :<\/p>\n<ol>\n<li>Addition<\/li>\n<li>Subtraction<\/li>\n<li>Multiplication<\/li>\n<li>Division<\/li>\n<li>Modulus<\/li>\n<li>Exponentiation<\/li>\n<li>Floor division<\/li>\n<\/ol>\n<p><strong>1. Addition Operator :\u00a0<\/strong>In Python,\u00a0<strong>+<\/strong>\u00a0is the addition operator. It is used to add 2 values.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_693255\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the addition operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">+<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>5<\/pre>\n<p><strong>2. Subtraction Operator :\u00a0<\/strong>In Python,\u00a0<strong>\u2013<\/strong>\u00a0is the subtraction operator. It is used to subtract the second value from the first value.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_661980\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the subtraction operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">-<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>-1<\/pre>\n<p><strong>3. Multiplication Operator :\u00a0<\/strong>In Python,\u00a0<strong>*<\/strong>\u00a0is the multiplication operator. It is used to find the product of 2 values.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_424902\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the multiplication operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">*<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>6<\/pre>\n<p><strong>4. Division Operator :\u00a0<\/strong>In Python,\u00a0<strong>\/<\/strong>\u00a0is the division operator. It is used to find the quotient when first operand is divided by the second.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_742984\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the division operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">\/<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>1.5<\/pre>\n<p><strong>5. Modulus Operator :\u00a0<\/strong>In Python,\u00a0<strong>%<\/strong>\u00a0is the modulus operator. It is used to find the remainder when first operand is divided by the second.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_117277\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the modulus operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">%<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>1<\/pre>\n<p><strong>6. Exponentiation Operator :\u00a0<\/strong>In Python,\u00a0<strong>**<\/strong>\u00a0is the exponentiation operator. It is used to raise the first operand to power of second.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_755890\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the exponentiation operator<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">*<\/code><code class=\"keyword\">*<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>8<\/pre>\n<p><strong>7. Floor division :\u00a0<\/strong>In Python,\u00a0<strong>\/\/<\/strong>\u00a0is used to conduct the floor division. It is used to find the floorof the quotient when first operand is divided by the second.<br \/>\n<strong>Example :<\/strong><\/p>\n<div class=\"code-block\">\n<div class=\"code-container\">\n<div id=\"highlighter_423679\" class=\"syntaxhighlighter nogutter\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"plain\">val1 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">3<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"plain\">val2 <\/code><code class=\"keyword\">=<\/code> <code class=\"value\">2<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"undefined spaces\">\u00a0<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"comments\"># using the floor division<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"plain\">res <\/code><code class=\"keyword\">=<\/code> <code class=\"plain\">val1 <\/code><code class=\"keyword\">\/<\/code><code class=\"keyword\">\/<\/code> <code class=\"plain\">val2<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"functions\">print<\/code><code class=\"plain\">(res)<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<p><strong>Output :<\/strong><\/p>\n<pre>1<\/pre>\n<p>Below is the summary of all the 7 operators :<\/p>\n<table class=\"math-table\">\n<tbody>\n<tr>\n<th>Operator<\/th>\n<th>Description<\/th>\n<th>Syntax<\/th>\n<\/tr>\n<tr>\n<td>+<\/td>\n<td>Addition: adds two operands<\/td>\n<td>x + y<\/td>\n<\/tr>\n<tr>\n<td>\u2013<\/td>\n<td>Subtraction: subtracts two operands<\/td>\n<td>x \u2013 y<\/td>\n<\/tr>\n<tr>\n<td>*<\/td>\n<td>Multiplication: multiplies two operands<\/td>\n<td>x * y<\/td>\n<\/tr>\n<tr>\n<td>\/<\/td>\n<td>Division (float): divides the first operand by the second<\/td>\n<td>x \/ y<\/td>\n<\/tr>\n<tr>\n<td>\/\/<\/td>\n<td>Division (floor): divides the first operand by the second<\/td>\n<td>x \/\/ y<\/td>\n<\/tr>\n<tr>\n<td>%<\/td>\n<td>Modulus: returns the remainder when first operand is divided by the second<\/td>\n<td>x % y<\/td>\n<\/tr>\n<tr>\n<td>**<\/td>\n<td>Power : Returns first raised to power second<\/td>\n<td>x ** y<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: center;\"><strong><a href=\"https:\/\/bit.ly\/3ELmCiA\" target=\"_blank\" rel=\"noopener\">Learn Coding in your Language! Enroll Here!<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Constructs in Python programming language that instruct the interpreter to perform a certain function involving two or more variables upon which the construct operates are called python operators. Though not actually seen as functions, they have their own identity as concepts because they are different syntactically and semantically from functions. It performs tasks of various [&hellip;]<\/p>\n","protected":false},"author":111,"featured_media":25526943,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[802,1888],"tags":[],"class_list":["post-25526708","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-python-programming"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What are the different types of operators in Python - Entri Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are the different types of operators in Python - Entri Blog\" \/>\n<meta property=\"og:description\" content=\"Constructs in Python programming language that instruct the interpreter to perform a certain function involving two or more variables upon which the construct operates are called python operators. Though not actually seen as functions, they have their own identity as concepts because they are different syntactically and semantically from functions. It performs tasks of various [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/entri.me\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-04T15:05:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-22T11:34:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png\" \/>\n\t<meta property=\"og:image:width\" content=\"820\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Feeba Mahin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@entri_app\" \/>\n<meta name=\"twitter:site\" content=\"@entri_app\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Feeba Mahin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\"},\"author\":{\"name\":\"Feeba Mahin\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/f036dab84abae3dcc9390a1110d95d36\"},\"headline\":\"What are the different types of operators in Python\",\"datePublished\":\"2022-06-04T15:05:14+00:00\",\"dateModified\":\"2022-11-22T11:34:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\"},\"wordCount\":2724,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png\",\"articleSection\":[\"Articles\",\"Python Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\",\"url\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\",\"name\":\"What are the different types of operators in Python - Entri Blog\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png\",\"datePublished\":\"2022-06-04T15:05:14+00:00\",\"dateModified\":\"2022-11-22T11:34:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png\",\"width\":820,\"height\":615,\"caption\":\"What are the different types of operators in Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Programming\",\"item\":\"https:\/\/entri.app\/blog\/category\/python-programming\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"What are the different types of operators in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/blog\/#website\",\"url\":\"https:\/\/entri.app\/blog\/\",\"name\":\"Entri Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/blog\/#organization\",\"name\":\"Entri App\",\"url\":\"https:\/\/entri.app\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"width\":989,\"height\":446,\"caption\":\"Entri App\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/entri.me\/\",\"https:\/\/x.com\/entri_app\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/f036dab84abae3dcc9390a1110d95d36\",\"name\":\"Feeba Mahin\",\"url\":\"https:\/\/entri.app\/blog\/author\/feeba123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What are the different types of operators in Python - Entri Blog","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:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/","og_locale":"en_US","og_type":"article","og_title":"What are the different types of operators in Python - Entri Blog","og_description":"Constructs in Python programming language that instruct the interpreter to perform a certain function involving two or more variables upon which the construct operates are called python operators. Though not actually seen as functions, they have their own identity as concepts because they are different syntactically and semantically from functions. It performs tasks of various [&hellip;]","og_url":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/","og_site_name":"Entri Blog","article_publisher":"https:\/\/www.facebook.com\/entri.me\/","article_published_time":"2022-06-04T15:05:14+00:00","article_modified_time":"2022-11-22T11:34:44+00:00","og_image":[{"width":820,"height":615,"url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png","type":"image\/png"}],"author":"Feeba Mahin","twitter_card":"summary_large_image","twitter_creator":"@entri_app","twitter_site":"@entri_app","twitter_misc":{"Written by":"Feeba Mahin","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#article","isPartOf":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/"},"author":{"name":"Feeba Mahin","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/f036dab84abae3dcc9390a1110d95d36"},"headline":"What are the different types of operators in Python","datePublished":"2022-06-04T15:05:14+00:00","dateModified":"2022-11-22T11:34:44+00:00","mainEntityOfPage":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/"},"wordCount":2724,"commentCount":0,"publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"image":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png","articleSection":["Articles","Python Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/","url":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/","name":"What are the different types of operators in Python - Entri Blog","isPartOf":{"@id":"https:\/\/entri.app\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage"},"image":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png","datePublished":"2022-06-04T15:05:14+00:00","dateModified":"2022-11-22T11:34:44+00:00","breadcrumb":{"@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#primaryimage","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/06\/What-are-the-different-types-of-operators-in-Python.png","width":820,"height":615,"caption":"What are the different types of operators in Python"},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/blog\/what-are-the-different-types-of-operators-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Programming","item":"https:\/\/entri.app\/blog\/category\/python-programming\/"},{"@type":"ListItem","position":3,"name":"What are the different types of operators in Python"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/blog\/#website","url":"https:\/\/entri.app\/blog\/","name":"Entri Blog","description":"","publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/blog\/#organization","name":"Entri App","url":"https:\/\/entri.app\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","width":989,"height":446,"caption":"Entri App"},"image":{"@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/entri.me\/","https:\/\/x.com\/entri_app"]},{"@type":"Person","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/f036dab84abae3dcc9390a1110d95d36","name":"Feeba Mahin","url":"https:\/\/entri.app\/blog\/author\/feeba123\/"}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25526708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/users\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/comments?post=25526708"}],"version-history":[{"count":7,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25526708\/revisions"}],"predecessor-version":[{"id":25547739,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25526708\/revisions\/25547739"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/media\/25526943"}],"wp:attachment":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/media?parent=25526708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/categories?post=25526708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/tags?post=25526708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}