{"id":68518,"date":"2023-07-18T02:53:09","date_gmt":"2023-07-18T02:53:09","guid":{"rendered":"https:\/\/itsourcecode.com\/?p=68518"},"modified":"2023-10-25T08:51:22","modified_gmt":"2023-10-25T08:51:22","slug":"what-is-set-in-python-with-example","status":"publish","type":"post","link":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/","title":{"rendered":"Exploring Sets in Python: Usage, Comparisons, and Operations"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-what-is-set-in-python\"><strong><strong>What is Set in Python?<\/strong><\/strong><\/h2>\n\n\n\n<p>A <strong>set <\/strong>is a collection of elements that can be iterated over and changed and does not contain duplicate elements or an index. Sets let you store multiple items in a single variable.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Sets <\/strong>are one of the four built-in data types in Python, along with <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/lists-in-python-with-examples\/\">Lists<\/a>, <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-tuple-in-python-with-examples\/\">Tuples<\/a>, and <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/\">dictionaries<\/a>. Each data type has different uses and qualities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-does-set-do-in-python\"><strong>What does set do in Python?<\/strong><\/h2>\n\n\n\n<p><strong>Python sets <\/strong>are useful because they <strong>cannot contain duplicate values<\/strong>, making them ideal for eliminating duplicates in lists or tuples, and for performing common math operations like unions and intersections.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Create sets in Python<\/strong><\/h2>\n\n\n\n<p class=\"tw-highlight-padding\">A <strong>set <\/strong>can be created by placing elements inside curly braces <mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong>{}<\/strong><\/mark> and separating them with a comma <strong><code>(<mark style=\"background-color:var(--base-3);color:#fb0000\" class=\"has-inline-color\">,<\/mark>)<\/code><\/strong>, or by using the built-in <mark style=\"background-color:var(--base-3);color:#fc0000\" class=\"has-inline-color\"><strong>set()<\/strong><\/mark> function. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">Creating an empty set can be done by using empty curly braces.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code tw-rounded\"><code>x = {}\ny = set(&#91;'Python', 'is', 'Fun'])\n\nprint(x)\nprint(y)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted tw-rounded\"><strong>{}\n{'Fun', 'Python', 'is'}<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Note<\/strong>: Set is an <strong>unordered collection of items<\/strong> that is iterable. If you run your code again the list will change positions.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-initialize-a-set-in-python\"><strong>Initialize a Set in Python<\/strong><\/h2>\n\n\n\n<p>You can initialize a set in Python by using <strong>set()<\/strong> or putting all of the items (elements) inside <strong>curly braces {}<\/strong> and putting a <strong>comma<\/strong> between each one.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code tw-rounded\"><code><strong># using the Set function\nset1 = set(&#91;'India', 'Philippines'])\nprint(set1, 'and the following type is', type(set1))\n\n# using curly braces {}\nset1 = {'Hello', 'Hey', 'Hi'}\nprint(set1, 'and the following type is', type(set1))<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted tw-rounded\"><strong>{'Philippines', 'India'} and the following type is &lt;class 'set'&gt;\n{'Hello', 'Hi', 'Hey'} and the following type is &lt;class 'set'&gt;<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-modifying-a-set-in-python\"><strong>Modifying a set in Python<\/strong><\/h2>\n\n\n\n<p class=\"tw-highlight-padding\">To modify a set in Python, you can use the <mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong>add()<\/strong><\/mark> method to add one element at a time, or the<strong> update() <\/strong>method to add several elements at once. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">The <strong>update() <\/strong>method can be used with tuples, lists, strings, or other sets.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code tw-rounded\"><code><strong># initialize set1\nset1 = {1, 3}\nprint(set1)\n\n# add an element\nset1.add(2)\nprint(set1)\n\n# add multiple elements\nset1.update(&#91;2, 3, 4])\nprint(set1)\n\n# add list and set\nset1.update(&#91;4, 5], {1, 6, 7})\nprint(set1)<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted tw-rounded\"><strong>{1, 3}\n{1, 2, 3}\n{1, 2, 3, 4}\n{1, 2, 3, 4, 5, 6, 7}<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-removing-elements-from-a-set\"><strong>Removing Elements from a Set<\/strong><\/h2>\n\n\n\n<p>Use the <strong>remove() or discard()<\/strong> method to remove elements from a set.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">The <mark style=\"background-color:var(--base-3);color:#fd0000\" class=\"has-inline-color\"><strong>discard()<\/strong><\/mark> function does nothing if an element is not in a set, while the <strong>remove()<\/strong> function will throw an error if the element is not present.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>set1 = {'Prince', 'Adones', 'Jude', 'Paul', 'Ted', 'Glen', 'Jaymar'}\n\nset1.discard('Adones')\nprint('using discard',set1) # discard an element\n\nset1.remove('Ted')\nprint('using remove',set1) # remove an element<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted tw-rounded\"><strong>using discard {'Paul', 'Ted', 'Jaymar', 'Prince', 'Glen', 'Jude'}\nusing remove {'Paul', 'Jaymar', 'Prince', 'Glen', 'Jude'}<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">We can remove an item from a set using the <mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong>pop()<\/strong><\/mark> method. Since sets are unordered, we can&#8217;t predict which item will be removed.<\/p>\n\n\n\n<p class=\"tw-highlight-padding\">We can also clear a set of all its items using the <mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong>clear()<\/strong><\/mark> method.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>set1 = {'Prince', 'Adones', 'Jude', 'Paul', 'Ted', 'Glen', 'Jaymar'}\n\nprint(set1.pop()) # pop an random element\n\n# clear set1\nset1.clear()\nprint('After clearing:',set1) # this will empty the set<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted tw-rounded\"><strong>Jaymar\nAfter clearing: set()<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-set-operations\"><strong>Python Set Operations<\/strong><\/h2>\n\n\n\n<p>Python sets can be operated using <strong>union, intersection, difference, and symmetric difference<\/strong>. These operations can be performed using either operators or methods.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>A = {1, 2, 3, 4, 5}\nB = {5, 6, 7, 8, 9}<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>The list below shows the description of Python Set Operations and their diagrams with examples:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-set-union\"><strong>Set Union<\/strong><\/h3>\n\n\n\n<p><strong>Set Union<\/strong> &#8211; is a set that has all the elements from both sets.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Union.png\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Union.png\" alt=\"What is Set in Python with Examples\" class=\"wp-image-70142\" srcset=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Union.png 400w, https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Union-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><figcaption class=\"wp-element-caption\">Set Union Diagram<\/figcaption><\/figure><\/div>\n\n\n<p><\/p>\n\n\n\n<p class=\"tw-highlight-padding\">The<strong> |<\/strong> operator and the <strong>union() <\/strong>method are used to make a union.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>A = {1, 2, 3, 4, 5}\nB = {5, 6, 7, 8, 9}\n\n# using the | operator\nprint (A | B)\n\n# using the union function\nprint (A.union(B))<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>{1, 2, 3, 4, 5, 6, 7, 8, 9}\n{1, 2, 3, 4, 5, 6, 7, 8, 9}<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-set-intersection\"><strong>Set Intersection<\/strong><\/h3>\n\n\n\n<p><strong>Set Intersection<\/strong> &#8211; is a set of elements that are in both A and B.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Intersection.png\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Intersection.png\" alt=\"What is Set in Python with Examples\" class=\"wp-image-70146\" srcset=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Intersection.png 400w, https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Intersection-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><figcaption class=\"wp-element-caption\">Set Intersection Diagram<\/figcaption><\/figure><\/div>\n\n\n<p>The<strong> <\/strong><mark style=\"background-color:var(--base);color:#fa0000\" class=\"has-inline-color\"><strong>&amp;<\/strong><\/mark> operator and the <strong><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">intersection()<\/mark> <\/strong>method are used to make an intersection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>A = {1, 2, 3, 4, 5}\nB = {5, 6, 7, 8, 9}\n\n# using the &amp; operator\nprint (A &amp; B)\n\n# using the intersection function\nprint (A.intersection(B))<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>{5}\n{5}<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-set-difference\"><strong>Set Difference<\/strong><\/h3>\n\n\n\n<p><strong>Set <strong>Difference<\/strong><\/strong> &#8211; is a set of elements that are only in set A and not in set B. In the same way, B &#8211; A is a set of elements that are in B but not in A.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Difference.png\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Difference.png\" alt=\"What is Set in Python with Examples\" class=\"wp-image-70158\" srcset=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Difference.png 400w, https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Difference-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><figcaption class=\"wp-element-caption\">Set Difference Diagram<\/figcaption><\/figure><\/div>\n\n\n<p>The<strong> <\/strong><code><mark style=\"background-color:var(--base);color:#fa0000\" class=\"has-inline-color\">-<\/mark><\/code> operator and the <mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\"><strong>difference()<\/strong><\/mark> method are used to make a difference.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>A = {1, 2, 3, 4, 5}\nB = {5, 6, 7, 8, 9}\n\n# using the - operator on A\nprint (A - B)\n\n# using the - operator on B\nprint (B - A)\n\n# using the difference function on A\nprint (A.difference(B))\n\n# using the difference function on B\nprint (B.difference(A))<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>{1, 2, 3, 4}\n{8, 9, 6, 7}\n{1, 2, 3, 4}\n{8, 9, 6, 7}<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-set-symmetric-difference\"><strong>Set Symmetric\u00a0Difference<\/strong><\/h3>\n\n\n\n<p><strong><strong>Set Symmetric\u00a0Difference<\/strong><\/strong> &#8211; a set of elements in A and B that aren&#8217;t in B (excluding the intersection).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Symmetric-Difference.png\"><img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"300\" src=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Symmetric-Difference.png\" alt=\"What is Set in Python with Examples\" class=\"wp-image-70163\" srcset=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Symmetric-Difference.png 400w, https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/Set-Symmetric-Difference-300x225.png 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/a><figcaption class=\"wp-element-caption\">Set Symmetric&nbsp;Difference Diagram<\/figcaption><\/figure><\/div>\n\n\n<p>The<strong> <\/strong><mark style=\"background-color:var(--base);color:#fa0000\" class=\"has-inline-color\"><strong>^<\/strong><\/mark> operator and the <strong><mark style=\"background-color:var(--base-3);color:#ff0000\" class=\"has-inline-color\">symmetric_difference()<\/mark> <\/strong>method are used to make a symmetric difference.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>A = {1, 2, 3, 4, 5}\nB = {5, 6, 7, 8, 9}\n\n# using the ^ operator on A\nprint (A ^ B)\n\n# using the symmetric_difference function\nprint (A.symmetric_difference (B))<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>{1, 2, 3, 4, 6, 7, 8, 9}\n{1, 2, 3, 4, 6, 7, 8, 9}<\/strong><\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-set-functions\"><strong>Python Set Functions<\/strong><\/h2>\n\n\n\n<p>In&nbsp;the&nbsp;table&nbsp;below,&nbsp;you&#8217;ll&nbsp;find&nbsp;a&nbsp;list&nbsp;of&nbsp;<strong>Python&nbsp;Set&nbsp;Functions<\/strong>&nbsp;that&nbsp;are&nbsp;commonly&nbsp;used&nbsp;with&nbsp;sets&nbsp;to&nbsp;do&nbsp;different&nbsp;tasks.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Function<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">all()<\/td><td>Returns <code>True<\/code> if all elements of the set are true (or if the set is empty).<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">any()<\/td><td>Returns <code>True<\/code> if any element of the set is true. If the set is empty, returns <code>False<\/code>.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">enumerate()<\/td><td>Returns an enumerate object. It contains the index and value for all the items of the set as a pair.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">len()<\/td><td>Returns the length (the number of items) in the set.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">max()<\/td><td>Returns the largest item in the set.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">min()<\/td><td>Returns the smallest item in the set.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">sorted()<\/td><td>Returns a new sorted list from elements in the set(does not sort the set itself).<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">sum()<\/td><td>Returns the sum of all elements in the set.<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Python Set Functions<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-python-set-methods\"><strong>Python Set Methods<\/strong><\/h2>\n\n\n\n<p>Python has many <strong>Set Methods<\/strong> and we&#8217;ve already talked about some of them. Here is a list of all the ways that set objects can be used:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Methods<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">add()<\/td><td>Adds an element to the set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">clear()<\/td><td>Removes all elements from the set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">copy()<\/td><td>Returns a copy of the set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">difference()<\/td><td>Returns the difference of two or more sets as a new set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">difference_update()<\/td><td>Removes all elements of another set from this set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">discard()<\/td><td>Removes an element from the set if it is a member. (Do nothing if the element is not in set)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">intersection()<\/td><td>Returns the intersection of two sets as a new set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">intersection_update()<\/td><td>Updates the set with the intersection of itself and another<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><a href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-isdisjoint-in-python-with-example\/\">isdisjoint()<\/a><\/td><td>Returns <code>True<\/code> if two sets have a null intersection<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">issubset()<\/td><td>Returns <code>True<\/code> if another set contains this set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">issuperset()<\/td><td>Returns <code>True<\/code> if this set contains another set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">pop()<\/td><td>Removes and returns an arbitrary set element. Raises <code>KeyError<\/code> if the set is empty<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">remove()<\/td><td>Removes an element from the set. If the element is not a member, raises a <code>KeyError<\/code><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">symmetric_difference()<\/td><td>Returns the symmetric difference of two sets as a new set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">symmetric_difference_update()<\/td><td>Updates a set with the symmetric difference of itself and another<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">union()<\/td><td>Returns the union of sets in a new set<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">update()<\/td><td>Updates the set with the union of itself and others<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Python Set Methods<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-list-vs-set-in-python\"><strong>List vs Set in Python<\/strong><\/h2>\n\n\n\n<p><strong>Sets vs. lists in Python<\/strong> differ primarily in their ability to store unique elements. Sets only store unique values and automatically eliminate duplicates, while lists preserve the order of elements and allow duplicates.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you need to handle a collection of distinct values or perform efficient membership testing, sets are the ideal choice.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-summary\"><strong>Summary<\/strong><\/h2>\n\n\n\n<p>In this tutorial, we have comprehended the set data type in Python. This includes what sets are, and why you would use them. We have also seen some examples of set operations.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>I hope this lesson has helped you understand <strong>what is a set in Python and its uses<\/strong>. If you missed any of our previous lessons, check out our list of <a href=\"https:\/\/itsourcecode.com\/python-tutorial\/python-tutorial-for-absolute-beginners\/\">Python tutorials for absolute beginners<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns tw-mb-0 tw-stretched-blocks tw-justify-center tw-gutter-no tw-cols-stack-sm tw-cols-card tw-cols-card-border tw-stretched-link is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-left is-nowrap is-layout-flex wp-container-core-buttons-is-layout-558b13e7 wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-tuple-in-python-with-examples\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\">\u2770\u2770<\/mark> <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Previous<\/strong><\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-left tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\">Python Tuples<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column tw-mt-0 tw-mb-0 is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-buttons tw-mb-0 tw-mt-0 is-content-justification-right is-nowrap is-layout-flex wp-container-core-buttons-is-layout-5054138e wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-base-3-background-color has-background wp-element-button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/is-dictionary-mutable-in-python\/\" style=\"border-radius:0px\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-accent-color\"><strong>Next <\/strong>\u2771\u2771<\/mark><\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-right tw-mt-0 tw-mb-0 tw-link-hover-underline\" style=\"font-style:normal;font-weight:100\">Python Dictionaries<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is Set in Python? A set is a collection of elements that can be iterated over and changed and does not contain duplicate elements or an index. Sets let &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Exploring Sets in Python: Usage, Comparisons, and Operations\" class=\"read-more button\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#more-68518\" aria-label=\"Read more about Exploring Sets in Python: Usage, Comparisons, and Operations\">Read more<\/a><\/p>\n","protected":false},"author":1373,"featured_media":69945,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61036],"tags":[90182,90181,90171,90179,90163,90175,90174,90173,89368,90165,90166,90164,90167,90177,90178,90162,90169,90161,90160,90176,90180,90170],"class_list":["post-68518","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-tutorial","tag-are-sets-in-python-immutable","tag-are-sets-in-python-mutable","tag-is-python-set-mutable","tag-is-python-set-ordered","tag-lists-vs-tuples-vs-sets","tag-python-set-vs-dict","tag-python-set-vs-list","tag-python-set-vs-list-vs-tuple","tag-python-set-vs-list-vs-tuple-vs-dict","tag-sets-vs-list","tag-sets-vs-lists","tag-sets-vs-lists-vs-tuples","tag-sets-vs-tuples","tag-what-is-python-set-with-example","tag-what-is-python-set-with-examples","tag-what-is-python-sets","tag-what-is-python-syntax","tag-what-is-set-in-python","tag-what-is-set-in-python-with-example","tag-what-is-set-in-python-with-examples","tag-what-is-set-method-in-python","tag-what-is-sets-in-python","resize-featured-image"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Exploring Sets in Python: Usage, Comparisons, and Operations<\/title>\n<meta name=\"description\" content=\"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exploring Sets in Python: Usage, Comparisons, and Operations\" \/>\n<meta property=\"og:description\" content=\"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Itsourcecode.com\" \/>\n<meta property=\"article:author\" content=\"www.facebook.com\/unguardable7\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-18T02:53:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-25T08:51:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1460\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Ly Cesar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/www.twitter.com\/unguardable0729\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prince Ly Cesar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/\"},\"author\":{\"name\":\"Prince Ly Cesar\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\"},\"headline\":\"Exploring Sets in Python: Usage, Comparisons, and Operations\",\"datePublished\":\"2023-07-18T02:53:09+00:00\",\"dateModified\":\"2023-10-25T08:51:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/\"},\"wordCount\":1066,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Sets.png\",\"keywords\":[\"are sets in python immutable\",\"are sets in python mutable\",\"is python set mutable\",\"is python set ordered\",\"lists vs tuples vs sets\",\"python set vs dict\",\"python set vs list\",\"python set vs list vs tuple\",\"python set vs list vs tuple vs dict\",\"sets vs list\",\"sets vs lists\",\"sets vs lists vs tuples\",\"sets vs tuples\",\"what is python set with example\",\"what is python set with examples\",\"what is python sets\",\"what is python syntax\",\"what is set in python\",\"what is set in python with example\",\"what is set in python with examples\",\"what is set method in python\",\"what is sets in python\"],\"articleSection\":[\"Python Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/\",\"name\":\"Exploring Sets in Python: Usage, Comparisons, and Operations\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Sets.png\",\"datePublished\":\"2023-07-18T02:53:09+00:00\",\"dateModified\":\"2023-10-25T08:51:22+00:00\",\"description\":\"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#primaryimage\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Sets.png\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/PYTHON-TUTORIAL-Sets.png\",\"width\":1460,\"height\":900,\"caption\":\"What is Set in Python with Examples\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/python-tutorial\\\/what-is-set-in-python-with-example\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/itsourcecode.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Exploring Sets in Python: Usage, Comparisons, and Operations\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#website\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/\",\"name\":\"Itsourcecode.com\",\"description\":\"Partner In Your Coding Journey!\",\"publisher\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/itsourcecode.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/ad9e0497e03b85a9ca299d935298f5dc\",\"name\":\"itsourcecode\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\",\"width\":409,\"height\":409,\"caption\":\"itsourcecode\"},\"logo\":{\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/IT-SOURCECODE_ICON-07.jpg\"},\"description\":\"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!\",\"sameAs\":[\"https:\\\/\\\/itsourcecode.com\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/#\\\/schema\\\/person\\\/8d6ff1c108160ddbd60ff17cbb9f626b\",\"name\":\"Prince Ly Cesar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"contentUrl\":\"https:\\\/\\\/itsourcecode.com\\\/wp-content\\\/litespeed\\\/avatar\\\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215\",\"caption\":\"Prince Ly Cesar\"},\"description\":\"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode\",\"sameAs\":[\"https:\\\/\\\/activadorkeys.com\\\/\",\"www.facebook.com\\\/unguardable7\",\"http:\\\/\\\/www.instagram.com\\\/prnclycsr\\\/\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/www.twitter.com\\\/unguardable0729\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber\"],\"gender\":\"male\",\"knowsAbout\":[\"Graphic Designing\"],\"knowsLanguage\":[\"English\",\"Tagalog\"],\"jobTitle\":\"Graphic Designer\",\"worksFor\":\"IT SourceCode\",\"url\":\"https:\\\/\\\/itsourcecode.com\\\/author\\\/unguardable\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Exploring Sets in Python: Usage, Comparisons, and Operations","description":"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/","og_locale":"en_US","og_type":"article","og_title":"Exploring Sets in Python: Usage, Comparisons, and Operations","og_description":"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.","og_url":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/","og_site_name":"Itsourcecode.com","article_author":"www.facebook.com\/unguardable7","article_published_time":"2023-07-18T02:53:09+00:00","article_modified_time":"2023-10-25T08:51:22+00:00","og_image":[{"width":1460,"height":900,"url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png","type":"image\/png"}],"author":"Prince Ly Cesar","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/www.twitter.com\/unguardable0729","twitter_misc":{"Written by":"Prince Ly Cesar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#article","isPartOf":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/"},"author":{"name":"Prince Ly Cesar","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b"},"headline":"Exploring Sets in Python: Usage, Comparisons, and Operations","datePublished":"2023-07-18T02:53:09+00:00","dateModified":"2023-10-25T08:51:22+00:00","mainEntityOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/"},"wordCount":1066,"commentCount":0,"publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png","keywords":["are sets in python immutable","are sets in python mutable","is python set mutable","is python set ordered","lists vs tuples vs sets","python set vs dict","python set vs list","python set vs list vs tuple","python set vs list vs tuple vs dict","sets vs list","sets vs lists","sets vs lists vs tuples","sets vs tuples","what is python set with example","what is python set with examples","what is python sets","what is python syntax","what is set in python","what is set in python with example","what is set in python with examples","what is set method in python","what is sets in python"],"articleSection":["Python Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/","url":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/","name":"Exploring Sets in Python: Usage, Comparisons, and Operations","isPartOf":{"@id":"https:\/\/itsourcecode.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#primaryimage"},"image":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#primaryimage"},"thumbnailUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png","datePublished":"2023-07-18T02:53:09+00:00","dateModified":"2023-10-25T08:51:22+00:00","description":"What is set in Python, usage, comparison, and operations is the objective of this article. Set is a built-in data structure.","breadcrumb":{"@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#primaryimage","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2022\/07\/PYTHON-TUTORIAL-Sets.png","width":1460,"height":900,"caption":"What is Set in Python with Examples"},{"@type":"BreadcrumbList","@id":"https:\/\/itsourcecode.com\/python-tutorial\/what-is-set-in-python-with-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/itsourcecode.com\/"},{"@type":"ListItem","position":2,"name":"Exploring Sets in Python: Usage, Comparisons, and Operations"}]},{"@type":"WebSite","@id":"https:\/\/itsourcecode.com\/#website","url":"https:\/\/itsourcecode.com\/","name":"Itsourcecode.com","description":"Partner In Your Coding Journey!","publisher":{"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itsourcecode.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/ad9e0497e03b85a9ca299d935298f5dc","name":"itsourcecode","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","url":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg","width":409,"height":409,"caption":"itsourcecode"},"logo":{"@id":"https:\/\/itsourcecode.com\/wp-content\/uploads\/2021\/01\/IT-SOURCECODE_ICON-07.jpg"},"description":"Hello Itsourcecoders, welcome to itsourcecode.com. I'm Joken Villanueva, MIT a passionate Blogger, Programmer and a Hobbyist. I started Itsourcecode because I wanted to give back and Share all the learnings and knowledge I've learned in my career and I believe through this website I would be able to help and assist those newbie programmers in enhancing their skills from different programming languages. So let us all help each other by sharing our ideas!","sameAs":["https:\/\/itsourcecode.com\/"]},{"@type":"Person","@id":"https:\/\/itsourcecode.com\/#\/schema\/person\/8d6ff1c108160ddbd60ff17cbb9f626b","name":"Prince Ly Cesar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","url":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","contentUrl":"https:\/\/itsourcecode.com\/wp-content\/litespeed\/avatar\/8fc9fa13530f18706fe0948f4673fae8.jpg?ver=1776478215","caption":"Prince Ly Cesar"},"description":"Hi there! I'm Prince Ly Cesar a Student in Carlos Hilado Memorial State College - Binalbagan Campus and a Graphic Designer, Programmer &amp; Writer in IT SourceCode","sameAs":["https:\/\/activadorkeys.com\/","www.facebook.com\/unguardable7","http:\/\/www.instagram.com\/prnclycsr\/","https:\/\/x.com\/http:\/\/www.twitter.com\/unguardable0729","https:\/\/www.youtube.com\/channel\/UCF0BIqB5tpnCmwvYQCHucmw?view_as=subscriber"],"gender":"male","knowsAbout":["Graphic Designing"],"knowsLanguage":["English","Tagalog"],"jobTitle":"Graphic Designer","worksFor":"IT SourceCode","url":"https:\/\/itsourcecode.com\/author\/unguardable\/"}]}},"_links":{"self":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/68518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/users\/1373"}],"replies":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/comments?post=68518"}],"version-history":[{"count":13,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/68518\/revisions"}],"predecessor-version":[{"id":119320,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/posts\/68518\/revisions\/119320"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media\/69945"}],"wp:attachment":[{"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/media?parent=68518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/categories?post=68518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsourcecode.com\/wp-json\/wp\/v2\/tags?post=68518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}