{"id":33527,"date":"2022-10-14T11:14:28","date_gmt":"2022-10-14T05:44:28","guid":{"rendered":"https:\/\/tutorial.eyehunts.com\/?p=33527"},"modified":"2024-02-22T19:32:09","modified_gmt":"2024-02-22T14:02:09","slug":"identity-operators-in-python","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/","title":{"rendered":"Identity operators in Python"},"content":{"rendered":"\n<p>Python Identity operators are used to compare the <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-objects-basic\/\">objects <\/a>if both the objects are actually of the same data type and share the same memory location.<\/p>\n\n\n\n<p>There are two Identity operators as explained below \u2212<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>Operator<\/th><th>Description<\/th><th>Example<\/th><\/tr><tr><td>is<\/td><td>Evaluates to true if the variables on either side of the operator point to the same object and false otherwise.<\/td><td>x is y, here are results in 1 if id(x) equals id(y).<\/td><\/tr><tr><td>is not<\/td><td>Evaluates false if the variables on either side of the operator point to the same object and true otherwise.<\/td><td>x is not y, there are no results in 1 if id(x) is not equal to id(y).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Identity operators in Python<\/h2>\n\n\n\n<p>Simple example code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = 20\nb = 20\n\nif a is b:\n    print(\"a and b have same identity\")\nelse:\n    print(\"a and b do not have same identity\")\n\nif id(a) == id(b):\n    print(\"a and b have same identity\")\nelse:\n    print(\"a and b do not have same identity\")\n\nb = 30\nif a is b:\n    print(\"a and b have same identity\")\nelse:\n    print(\"a and b do not have same identity\")\n\nif a is not b:\n    print(\"a and b do not have same identity\")\nelse:\n    print(\"Line 4 - a and b have same identity\")\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"195\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg?resize=465%2C195&#038;ssl=1\" alt=\"Identity operators in Python\" class=\"wp-image-33576\"\/><\/figure><\/div>\n\n\n<p><strong>is operator<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x = '101'\ny = '101'\nz = '102'\n\nif x is y:\n    print('x is y')\nelse:\n    print('x is not y')\n    \nif x is z:\n    print('x is z')\nelse:\n    print('x is not z')\n\nif y is z:\n    print('y is z')\nelse:\n    print('y is not z')\n<\/code><\/pre>\n\n\n\n<p><strong>is not Operator<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x = '101'\ny = '101'\nz = '102'\n\nif x is not y:\n    print('x is not y')\nelse:\n    print('x not y')\n\nif x is not z:\n    print('x is not z')\nelse:\n    print('x is z')\n\nif y is not z:\n    print('y is not z')\nelse:\n    print('y is z')\n<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Use the operators to evaluate the following.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th scope=\"col\">Qn<\/th><th scope=\"col\">Equation<\/th><th scope=\"col\">True or False?<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>x = 200<br>y = 500<br>z = y<br><br>print(z is y)<\/td><td><strong>&nbsp;True&nbsp; <\/strong>or &nbsp;<strong> False&nbsp;<\/strong><\/td><\/tr><tr><td>2<\/td><td>x = 200<br>y = 500<br>z = y<br><br>print(x is not y)<\/td><td><strong>&nbsp;True&nbsp; <\/strong>or &nbsp;<strong> False&nbsp;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">What is the <strong>difference between &#8220;==&#8221; and &#8220;is&#8221;?<\/strong><\/h3>\n\n\n\n<p><strong>Answer<\/strong>:  The <strong>is operator<\/strong> will return True if two variables point to the same object, <strong>&#8220;==&#8221;<\/strong> if the objects referred to by the variables are equal.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Do comment if you have any doubts or suggestions on this Python operators topic.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note:<\/strong> IDE:&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.jetbrains.com\/pycharm\/\" target=\"_blank\">PyCharm<\/a>&nbsp;2021.3.3 (Community Edition)<\/p><p>Windows 10<\/p><p><strong>Python 3.10.1<\/strong><\/p><p>All<strong>&nbsp;Python Examples&nbsp;are in&nbsp;Python&nbsp;3<\/strong>, so Maybe its different from python 2 or upgraded versions.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory location. There are two Identity operators as explained below \u2212 Operator Description Example is Evaluates to true if the variables on either side of the operator point to the same&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Identity operators in Python<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[30],"tags":[494,95],"post_series":[],"class_list":["post-33527","post","type-post","status-publish","format-standard","hentry","category-python","tag-python-identity","tag-python-operator"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Identity operators in Python<\/title>\n<meta name=\"description\" content=\"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Identity operators in Python\" \/>\n<meta property=\"og:description\" content=\"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-14T05:44:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-22T14:02:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg\" \/>\n<meta name=\"author\" content=\"Rohit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\",\"name\":\"Identity operators in Python\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg\",\"datePublished\":\"2022-10-14T05:44:28+00:00\",\"dateModified\":\"2024-02-22T14:02:09+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg?fit=465%2C195&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg?fit=465%2C195&ssl=1\",\"width\":465,\"height\":195},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Identity operators in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\",\"url\":\"https:\/\/tutorial.eyehunts.com\/\",\"name\":\"Tutorial\",\"description\":\"By EyeHunts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\",\"name\":\"Rohit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855\",\"caption\":\"Rohit\"},\"description\":\"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.\",\"url\":\"https:\/\/tutorial.eyehunts.com\/author\/rohit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Identity operators in Python","description":"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...","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:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Identity operators in Python","og_description":"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...","og_url":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/","og_site_name":"Tutorial","article_published_time":"2022-10-14T05:44:28+00:00","article_modified_time":"2024-02-22T14:02:09+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg","type":"","width":"","height":""}],"author":"Rohit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/","url":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/","name":"Identity operators in Python","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg","datePublished":"2022-10-14T05:44:28+00:00","dateModified":"2024-02-22T14:02:09+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"Python Identity operators are used to compare the objects if both the objects are actually of the same data type and share the same memory...","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#primaryimage","url":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg?fit=465%2C195&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Identity-operators-in-Python.jpg?fit=465%2C195&ssl=1","width":465,"height":195},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/identity-operators-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"Identity operators in Python"}]},{"@type":"WebSite","@id":"https:\/\/tutorial.eyehunts.com\/#website","url":"https:\/\/tutorial.eyehunts.com\/","name":"Tutorial","description":"By EyeHunts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1","name":"Rohit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/","url":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855","contentUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777979855","caption":"Rohit"},"description":"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.","url":"https:\/\/tutorial.eyehunts.com\/author\/rohit\/"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":2109,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-operators-overview-examples\/","url_meta":{"origin":33527,"position":0},"title":"Python Operators Overview with Examples","author":"Rohit","date":"August 24, 2018","format":false,"excerpt":"Python\u00a0Operators are used to performing operations on variables and values. The operators use numbers, strings other data types to get the action and application make math calculation or logic In this tutorial, you will learn about different types of Python\u00a0Operators, their syntax expression, and how to use them with examples.\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python Operators Overview with Examples","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/08\/Python-Operators-Overview-with-Examples.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/08\/Python-Operators-Overview-with-Examples.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/08\/Python-Operators-Overview-with-Examples.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/08\/Python-Operators-Overview-with-Examples.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2018\/08\/Python-Operators-Overview-with-Examples.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":22931,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-is-operator\/","url_meta":{"origin":33527,"position":1},"title":"Python is operator","author":"Rohit","date":"September 5, 2023","format":false,"excerpt":"In Python, the is operator is used to check if two variables reference the same object in memory. It is often used to compare object identity rather than object equality. Here is the basic syntax of the is operator: object1 is object2 object1 and object2 are the two objects you\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2023\/09\/Python-is-operator.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":33573,"url":"https:\/\/tutorial.eyehunts.com\/python\/membership-operators-in-python\/","url_meta":{"origin":33527,"position":2},"title":"Membership Operators in Python","author":"Rohit","date":"October 26, 2022","format":false,"excerpt":"Python Membership operators are used to test if a sequence is presented in an object (such as strings, lists, or tuples). Python programming has two membership operators as explained below: OperatorDescriptionExampleinEvaluates to true if it finds a variable in the specified sequence and false otherwise.x in y, here in results\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Membership Operators in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Membership-Operators-in-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":33521,"url":"https:\/\/tutorial.eyehunts.com\/python\/relational-operators-in-python\/","url_meta":{"origin":33527,"position":3},"title":"Relational operators in Python","author":"Rohit","date":"November 3, 2022","format":false,"excerpt":"Python Relational operators are used for comparing the operand values on either side. It returns a boolean value, i.e., either True or False based on the value of operands. The following are the relational operators: OperatorNameDescriptionSyntax==Equal ToEqual to operator returns True if the first operand is equal to the second\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Relational operators in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/11\/Relational-operators-in-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":18642,"url":"https:\/\/tutorial.eyehunts.com\/python\/logical-operators-in-python\/","url_meta":{"origin":33527,"position":4},"title":"Logical operators in Python","author":"Rohit","date":"October 12, 2022","format":false,"excerpt":"Python Logical operators are used to combine conditional statements. Python has three Logical operators the and, or, not operators. OperatorMeaningExampleandTrue if both the operands are truex and yorTrue if either of the operands is truex or ynotTrue if operand is false (complements the operand)not x Logical operators in Python Simple\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Logical operators in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/10\/Logical-operators-in-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":36015,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-comparison-operators\/","url_meta":{"origin":33527,"position":5},"title":"Python comparison operators","author":"Rohit","date":"July 6, 2023","format":false,"excerpt":"Python comparison operators are used to compare values and determine their relationship. These operators allow you to check conditions and make decisions based on the results of the comparisons. Python provides several comparison operators, including: Equal to (==): Checks if two values are equal. Not equal to (!=): Checks if\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2023\/07\/Python-comparison-operators.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/33527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/comments?post=33527"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/33527\/revisions"}],"predecessor-version":[{"id":42491,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/33527\/revisions\/42491"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=33527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=33527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=33527"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=33527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}