{"id":19352,"date":"2025-09-10T18:25:00","date_gmt":"2025-09-10T12:55:00","guid":{"rendered":"https:\/\/milestone.ac.in\/blog-mit\/?p=19352"},"modified":"2025-09-10T18:25:00","modified_gmt":"2025-09-10T12:55:00","slug":"tuples-in-python","status":"publish","type":"post","link":"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/","title":{"rendered":"Tuples in Python: Syntax, Examples, and Practical Use Cases"},"content":{"rendered":"<p>Python is among the most popular and versatile programming languages, used for data science, web development, artificial intelligence, and much more. Learn about tuples in python which are one of the basic data structures you will use to store and manage your data. Although one naturally compares tuples to lists, they are useful for different situations.<\/p>\r\n\r\n<p>In this blog, we will discuss tuples in <a href=\"https:\/\/milestone.ac.in\/courses\/python-programming\">Python<\/a> and their syntax, its features, tuples advantages and disadvantages with real life examples to understand how and when you use tuple in python.<\/p>\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><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><\/span><\/a><\/span><\/div>\n<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:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#What_Are_Tuples_in_Python\" >What Are Tuples in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Why_Use_Tuples_Instead_of_Lists\" >Why Use Tuples Instead of Lists?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Syntax_of_Tuples_in_Python\" >Syntax of Tuples in Python<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Below_is_a_example_of_a_tuple\" >Below is a example of a tuple:<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Advantages_of_Tuples_in_Python\" >Advantages of Tuples in Python<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Heres_why_many_developers_prefer_using_tuples_over_other_data_structures\" >Here\u2019s why many developers prefer using tuples over other data structures:<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Key_Characteristics_of_Tuples\" >Key Characteristics of Tuples<\/a><ul class='ez-toc-list-level-6' ><li class='ez-toc-heading-level-6'><ul class='ez-toc-list-level-6' ><li class='ez-toc-heading-level-6'><ul class='ez-toc-list-level-6' ><li class='ez-toc-heading-level-6'><ul class='ez-toc-list-level-6' ><li class='ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Ordered_Collection\" >Ordered Collection<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Immutable_Nature\" >Immutable Nature<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Heterogeneous_Elements\" >Heterogeneous Elements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Allow_Duplicates\" >Allow Duplicates<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Practical_Use_Cases_of_Tuples_in_Python\" >Practical Use Cases of Tuples in Python<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Here_are_a_few_use_cases_where_you_can_make_use_of_tuples_in_Python\" >Here are a few use cases where you can make use of tuples in Python:<\/a><ul class='ez-toc-list-level-6' ><li class='ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Returning_Multiple_Values_from_Functions\" >Returning Multiple Values from Functions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Storing_Fix_Data\" >Storing Fix Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Using_Tuples_as_Dictionary_Keys\" >Using Tuples as Dictionary Keys<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Working_with_Databases\" >Working with Databases<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-6'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Maintaining_Data_Integrity\" >Maintaining Data Integrity<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Benefits_of_Tuples_in_Python\" >Benefits of Tuples in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Common_Errors_to_Avoid\" >Common Errors to Avoid<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#What_is_the_practical_use_of_tuples\" >What is the practical use of tuples?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#Are_tuples_faster_than_lists_in_Python\" >Are tuples faster than lists in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#How_to_convert_a_tuple_to_a_list\" >How to convert a tuple to a list?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/milestone.ac.in\/blog-mit\/tuples-in-python\/#How_to_get_value_from_tuple_in_Python\" >How to get value from tuple in Python?<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_Are_Tuples_in_Python\"><\/span>What Are Tuples in Python?<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>Tuples in python are an ordered collection of elements, similar to lists or arrays, but unlike them, tuple is immutable. Which means that once a tuple is created, the elements cannot be modified, added to, or removed. The fact that tuples are immutable allows them to be used as safe containers for data that you need to remain constant during the program execution, such as configuration variables that never change, or static datasets, etc.<\/p>\r\n\r\n<p>So for example, basic information of a person such as\u00a0name, age, and place can be stored in the form of a tuple. A tuple is a good option because, the above values are not going to\u00a0change frequently.<\/p>\r\n<h2><span class=\"ez-toc-section\" id=\"Why_Use_Tuples_Instead_of_Lists\"><\/span>Why Use Tuples Instead of Lists?<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nWhen it comes to tuples and\u00a0lists, most beginner programmers\u00a0will\u00a0ask the\u00a0question why\u00a0they should use\u00a0tuples?\r\n\r\nThere are many benefits of having an immutable type:\r\n<ul>\r\n \t<li><strong>Performance:<\/strong> Tuples are immutable and require less memory than lists. Therefore, they are generally faster than lists in certain operations.<\/li>\r\n \t<li><strong>Data Integrity:<\/strong> Tuples being immutable, prevent data modification which maintains data integrity in a program.<\/li>\r\n \t<li><strong>Hashability:<\/strong> Unlike lists, tuples have the property of being hashable, which means that they can be used as keys in dictionaries, making them useful for certain types of data mapping.<\/li>\r\n \t<li><strong>Security:<\/strong> Less chance of modifying data accidentally as it is immutable that can minimize the exposure to bugs.<\/li>\r\n<\/ul>\r\nThese advantages make tuples in\u00a0python\u00a0best suitable to contain data where values remain\u00a0stable.\r\n<h2><span class=\"ez-toc-section\" id=\"Syntax_of_Tuples_in_Python\"><\/span>Syntax of Tuples in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nCreating tuples in Python is quite easy; you can simply put items in parentheses () and separate them with a comma (,).\r\n<h5><span class=\"ez-toc-section\" id=\"Below_is_a_example_of_a_tuple\"><\/span>Below is a example of a tuple:<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\nSome examples include:\r\n<ul>\r\n \t<li>An empty tuple &#8211; ()<\/li>\r\n \t<li>A tuple with one item &#8211; (&#8220;Python&#8221;)<\/li>\r\n \t<li>A tuple with multiple data types including integers, strings, and floats. For example, a tuple containing a person\u2019s name, age, location, and work experience \u2013 (&#8220;Sumit&#8221;, 23, &#8220;Mumbai&#8221;, 3.5)<\/li>\r\n<\/ul>\r\nThis clean syntax makes tuples easy both to write and to read, which is especially good for beginners.\r\n<h2><span class=\"ez-toc-section\" id=\"Advantages_of_Tuples_in_Python\"><\/span>Advantages of Tuples in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<h5><span class=\"ez-toc-section\" id=\"Heres_why_many_developers_prefer_using_tuples_over_other_data_structures\"><\/span>Here\u2019s why many developers prefer using tuples over other data structures:<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\n<ul>\r\n \t<li>Faster execution due to their lightweight design.<\/li>\r\n \t<li>Reliable data handling with immutability ensuring no accidental changes.<\/li>\r\n \t<li>Versatile storage, allowing a mix of different data types.<\/li>\r\n \t<li>Better memory management, especially in large-scale applications.<\/li>\r\n \t<li>Safe for concurrent programming, as immutable data reduces the chances of errors.<\/li>\r\n<\/ul>\r\nThese benefits make tuples an excellent choice for projects where data stability and performance are priorities.\r\n<h2><span class=\"ez-toc-section\" id=\"Key_Characteristics_of_Tuples\"><\/span>Key Characteristics of Tuples<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTo know tuples better, here are their defining characteristics:\r\n<h6><span class=\"ez-toc-section\" id=\"Ordered_Collection\"><\/span>Ordered Collection<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nA tuple is an ordered collection of items, and its elements can be retrieved by their index.\r\n<h6><span class=\"ez-toc-section\" id=\"Immutable_Nature\"><\/span>Immutable Nature<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nThe values in a tuple object cannot be modified after they are created. This provides tuples with stability and makes them suitable for long-term storage of facts.\r\n<h6><span class=\"ez-toc-section\" id=\"Heterogeneous_Elements\"><\/span>Heterogeneous Elements<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nTuples can contain a mix of types, including numbers, strings, and other collections.\r\n<h6><span class=\"ez-toc-section\" id=\"Allow_Duplicates\"><\/span>Allow Duplicates<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nJust like lists, tuples may also contain duplicate values.\r\n\r\nThese features give Python&#8217;s tuples versatility, and they serve a useful purpose in programming.\r\n<h2><span class=\"ez-toc-section\" id=\"Practical_Use_Cases_of_Tuples_in_Python\"><\/span>Practical Use Cases of Tuples in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTuples are not only of theoretical interest; they are also widely used in practice.\r\n<h5><span class=\"ez-toc-section\" id=\"Here_are_a_few_use_cases_where_you_can_make_use_of_tuples_in_Python\"><\/span>Here are a few use cases where you can make use of tuples in Python:<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\n<h6><span class=\"ez-toc-section\" id=\"Returning_Multiple_Values_from_Functions\"><\/span>Returning Multiple Values from Functions<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nTuples are used to store multiple items in a single variable. For example, if you are returning multiple values from a function, it is better and simpler to use a tuple than a complex data type.\r\n<h6><span class=\"ez-toc-section\" id=\"Storing_Fix_Data\"><\/span>Storing Fix Data<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nIf you need data that does not change, for example, country codes, product categories, configuration settings, etc., then in Python it&#8217;s better to use tuples.\r\n<h6><span class=\"ez-toc-section\" id=\"Using_Tuples_as_Dictionary_Keys\"><\/span>Using Tuples as Dictionary Keys<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nBecause tuples are immutable, they can be used as keys in dictionaries, which can be useful for building complex data structures.\r\n<h6><span class=\"ez-toc-section\" id=\"Working_with_Databases\"><\/span>Working with Databases<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nThere are various database systems where you can get query results as tuples, and you can easily process them in a Python application itself.\r\n<h6><span class=\"ez-toc-section\" id=\"Maintaining_Data_Integrity\"><\/span>Maintaining Data Integrity<span class=\"ez-toc-section-end\"><\/span><\/h6>\r\nIn large applications, tuples help keep data secure by preventing accidental updates that could cause errors.\r\n\r\n&nbsp;\r\n<h2><span class=\"ez-toc-section\" id=\"Benefits_of_Tuples_in_Python\"><\/span>Benefits of Tuples in Python<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTuples have various benefits that place them at the very top of a developer&#8217;s list of data types in Python:\r\n<ul>\r\n \t<li><strong>Faster Processing<\/strong> \u2013 Because they are immutable, tuples are smaller in size and can process data faster than lists in certain situations.<\/li>\r\n \t<li><strong>Data Protection<\/strong> \u2013 Since tuples are immutable, they can never be changed, which guarantees that data cannot be inadvertently or mistakenly altered.<\/li>\r\n \t<li><strong>Allows Mixed Data Types<\/strong> \u2013 A single tuple can hold items of different types of data (numbers, text, etc.).<\/li>\r\n \t<li><strong>Thread-Safe<\/strong> \u2013 Tuples are guaranteed not to change on a new thread of execution or in multi-threaded\/concurrent aspects of programming.<\/li>\r\n \t<li><strong>Dictionary Keys<\/strong> \u2013 Tuples can act as dictionary keys, whereas lists cannot.<\/li>\r\n<\/ul>\r\nTuples are probably some of the best data types to use in Python when your project depends on speed, data integrity, and overall efficiency.\r\n<h2><span class=\"ez-toc-section\" id=\"Common_Errors_to_Avoid\"><\/span>Common Errors to Avoid<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\nTuples are easy to use, but new programmers can still make mistakes:\r\n<ul>\r\n \t<li>Forgetting the comma on a single-element tuple, and creating an incorrect data structure.<\/li>\r\n \t<li>Trying\u00a0to change a tuple &#8211; generating errors because a tuple is immutable.<\/li>\r\n \t<li>Confusing tuples with lists, and using the wrong data structure for a particular use case.<\/li>\r\n<\/ul>\r\nIf you are aware of the above mistakes, you can be more efficient in your use of tuples in Python and cleaner code overall.\r\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Tuples in Python are the most basic yet powerful among the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_structure\" rel=\"noopener\">data structures<\/a>. Their immutability, efficient indexing, and ability to store different data types make them key to the efficiency of programming.<\/p> \r\n<p>Gain insights into the syntax, properties, and real-world usage of tuples so that you can take advantage of tuples in building strong and scalable applications. Regardless of whether you use small scripts or large scripts, learning tuples will improve your Python programming skills, and help you handle data better.<\/p>\r\n\r\nWell, if you want to sharpen your python skills then begin with tuples today, they are an essential tool in any developers toolbox.\r\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<h5><span class=\"ez-toc-section\" id=\"What_is_the_practical_use_of_tuples\"><\/span>What is the practical use of tuples?<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\nTuples <span class=\"diff-highlight\">are<\/span> are used to store immutable, ordered collections of related data, <span class=\"diff-highlight\">particularly<\/span> <span class=\"diff-highlight\">if<\/span> the data should not change, <span class=\"diff-highlight\">or<\/span> <span class=\"diff-highlight\">as<\/span> <span class=\"diff-highlight\">in<\/span> <span class=\"diff-highlight\">the<\/span> <span class=\"diff-highlight\">case<\/span> <span class=\"diff-highlight\">of<\/span> coordinates, database records, or function returned multiple value.\r\n<h5><span class=\"ez-toc-section\" id=\"Are_tuples_faster_than_lists_in_Python\"><\/span>Are tuples faster than lists in Python?<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\nYes, Tuples are faster than lists in Python, because they are immutable and have less memory overhead.\r\n<h5><span class=\"ez-toc-section\" id=\"How_to_convert_a_tuple_to_a_list\"><\/span>How to convert a tuple to a list?<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\nA tuple can also be turned into a list by using the list function with the name of the tuple in brackets.\r\n<h5><span class=\"ez-toc-section\" id=\"How_to_get_value_from_tuple_in_Python\"><\/span>How to get value from tuple in Python?<span class=\"ez-toc-section-end\"><\/span><\/h5>\r\nYou can obtain a value from a tuple by using the number index of the value in square brackets.\r\n\r\n&nbsp;","protected":false},"excerpt":{"rendered":"Python is among the most popular and versatile programming languages, used for data science, web development, artificial intelligence, and much more. Learn about tuples in python which are one of the basic data structures you will use to store and manage your data. Although one naturally compares tuples to lists, they are useful for different [&hellip;]","protected":false},"author":2,"featured_media":19379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[38,226,270,269],"class_list":["post-19352","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science-and-analytics","tag-advantages-of-python","tag-python","tag-tuples","tag-tuples-in-python"],"acf":[],"_links":{"self":[{"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/posts\/19352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/comments?post=19352"}],"version-history":[{"count":31,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/posts\/19352\/revisions"}],"predecessor-version":[{"id":19384,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/posts\/19352\/revisions\/19384"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/media\/19379"}],"wp:attachment":[{"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/media?parent=19352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/categories?post=19352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/milestone.ac.in\/blog-mit\/wp-json\/wp\/v2\/tags?post=19352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}