{"id":18580,"date":"2021-08-26T11:40:26","date_gmt":"2021-08-26T06:10:26","guid":{"rendered":"https:\/\/tutorial.eyehunts.com\/?p=18580"},"modified":"2021-08-26T11:40:27","modified_gmt":"2021-08-26T06:10:27","slug":"python-get-first-element-of-tuple-example-code","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/","title":{"rendered":"Python get first element of tuple | Example code"},"content":{"rendered":"\n<p>You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.<\/p>\n\n\n\n<p>Tuple First element:-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tuple&#91;0]<\/code><\/pre>\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\"><strong>Example get the first element of the tuple<\/strong><\/h2>\n\n\n\n<p>Simple example code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tup = (1, 2, 3, 4, 5)\nprint(tup&#91;0])\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"242\" height=\"108\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg?resize=242%2C108&#038;ssl=1\" alt=\"Python get first element of tuple\" class=\"wp-image-18589\"\/><\/figure><\/div>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>Python gets the first elements from a tuple of strings<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>t = (\"aaa\", \"aab\", \"abc\", \"aba\", \"bcc\")\nprint(t&#91;0])\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: aaa<\/p>\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\"><strong>How to get the first element of each tuple in a list in Python?<\/strong><\/h3>\n\n\n\n<p><strong>Answer<\/strong>: Here is how to get the first element of each tuple in a list in Python<\/p>\n\n\n\n<p>Use a <a href=\"http:\/\/docs.python.org\/3\/tutorial\/datastructures.html#list-comprehensions\">list comprehension<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>list_tuple = &#91;(1, 2), (\"A\", \"B\"), (10, 20), (\"elt1\", \"elt2\")]\n\nres_list = &#91;x&#91;0] for x in list_tuple]\nprint(res_list)\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: [1, &#8216;A&#8217;, 10, &#8216;elt1&#8217;]<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Another example code<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rows = &#91;(1, 2), (3, 4), (5, 6)]\n\nres_list = &#91;x&#91;0] for x in rows]\nprint(res_list)\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: [1, 3, 5]<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Use indexing to get the first element of each tuple<\/strong><\/p>\n\n\n\n<p>Use a <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-for-loops-tutorial-example\/\">for-loop<\/a> to iterate through a list of tuples. Within the for-loop, use the indexing <strong>tuple[0]<\/strong> to access the first element of each tuple, and <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-append-to-list-while-iterating-example-code\/\">append <\/a>it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tuple_list = &#91;(\"a\", \"b\"), (\"c\", \"d\")]\n\nele = &#91;]\n\nfor x in tuple_list:\n    ele.append(x&#91;0])\n\nprint(ele)\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: [&#8216;a&#8217;, &#8216;c&#8217;]<\/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 and suggestions on this Python list code.<\/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>You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1. Tuple First element:- Example get the first element of the tuple Simple example code. Output: Python gets the first elements from a tuple of strings Output: aaa How to get the&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Python get first element of tuple | Example code<\/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":[83,100],"post_series":[],"class_list":["post-18580","post","type-post","status-publish","format-standard","hentry","category-python","tag-python-list","tag-python-tuple"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python get first element of tuple | Example code - EyeHunts<\/title>\n<meta name=\"description\" content=\"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.\" \/>\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\/python-get-first-element-of-tuple-example-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python get first element of tuple | Example code - EyeHunts\" \/>\n<meta property=\"og:description\" content=\"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T06:10:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-26T06:10:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.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\/python-get-first-element-of-tuple-example-code\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/\",\"name\":\"Python get first element of tuple | Example code - EyeHunts\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg\",\"datePublished\":\"2021-08-26T06:10:26+00:00\",\"dateModified\":\"2021-08-26T06:10:27+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg?fit=242%2C108&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg?fit=242%2C108&ssl=1\",\"width\":242,\"height\":108},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python get first element of tuple | Example code\"}]},{\"@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=1777374971\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971\",\"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":"Python get first element of tuple | Example code - EyeHunts","description":"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.","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\/python-get-first-element-of-tuple-example-code\/","og_locale":"en_US","og_type":"article","og_title":"Python get first element of tuple | Example code - EyeHunts","og_description":"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.","og_url":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/","og_site_name":"Tutorial","article_published_time":"2021-08-26T06:10:26+00:00","article_modified_time":"2021-08-26T06:10:27+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.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\/python-get-first-element-of-tuple-example-code\/","url":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/","name":"Python get first element of tuple | Example code - EyeHunts","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg","datePublished":"2021-08-26T06:10:26+00:00","dateModified":"2021-08-26T06:10:27+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"You can access Python tuples with indexes. The index of the first element is 0 and the last element has an index of n-1.","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#primaryimage","url":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg?fit=242%2C108&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Python-get-first-element-of-tuple.jpg?fit=242%2C108&ssl=1","width":242,"height":108},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-get-first-element-of-tuple-example-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"Python get first element of tuple | Example code"}]},{"@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=1777374971","contentUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971","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":20919,"url":"https:\/\/tutorial.eyehunts.com\/python\/what-is-a-tuple-in-python-basics\/","url_meta":{"origin":18580,"position":0},"title":"What is a tuple in Python | Basics","author":"Rohit","date":"November 30, 2021","format":false,"excerpt":"Tuples are store multiple items in a single variable in Python. A tuple is an immutable object meaning that we cannot change, add or remove items after the tuple has been created. empty_tuple = () mytuple = (\"apple\", \"banana\", \"cherry\") Python Tuples are used to store collections of data, and\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"What is a tuple in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/11\/What-is-a-tuple-in-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8405,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-sort-tuple-order-example\/","url_meta":{"origin":18580,"position":1},"title":"Python sort tuple | Order Example","author":"Rohit","date":"May 10, 2020","format":false,"excerpt":"You can sort the tuple by using the built-in function sorted()\u00a0or sort() in Python. sorted()\u00a0returns the sorted sequence. If you want to sort a list in place then use\u00a0list.sort(). Examples of sorting tuple in Python let's see the example of using multiple methods to sort a tuple in python. Use\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\/2020\/05\/Python-sort-tuple-Order-Example-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-sort-tuple-Order-Example-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-sort-tuple-Order-Example-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-sort-tuple-Order-Example-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":18047,"url":"https:\/\/tutorial.eyehunts.com\/python\/sort-list-of-tuples-by-first-element-python-example-code\/","url_meta":{"origin":18580,"position":2},"title":"Sort list of tuples by first element Python | Example code","author":"Rohit","date":"November 12, 2021","format":false,"excerpt":"Using the sorted() function or in-place sort are the ways to Sort a list of tuples by the first element in Python. Both methods need to use the key keyword. Note: key should be a function that identifies how to retrieve the comparable element from your data structure. In your\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Sort list of tuples by first element Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/11\/Sort-list-of-tuples-by-first-element-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":18578,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-get-value-from-tuple-example-code\/","url_meta":{"origin":18580,"position":3},"title":"Python get value from tuple | Example code","author":"Rohit","date":"September 6, 2021","format":false,"excerpt":"The get value from the Python tuple use index number inside square brackets [ ]. tuple[index] Example get value from the tuple in Python Simple example code. Get a single value from the tuple tup = (\"Python\", \"Java\", \"SQL\") print(tup[1]) Output: Get all values from a tuple Use for loop\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python get value from tuple","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/09\/Python-get-value-from-tuple.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":17199,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-print-tuple-values-example-code\/","url_meta":{"origin":18580,"position":4},"title":"Python print tuple values | Example code","author":"Rohit","date":"August 2, 2021","format":false,"excerpt":"Simply pass the tuple into the print function to print tuple values. It will print the exact tuple but if you want to print it with string then convert it to string. Print value from a tuple in python Simple python example code creates and prints the tuple. mytuple =\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\/2021\/08\/Python-print-tuple-values.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":20947,"url":"https:\/\/tutorial.eyehunts.com\/python\/convert-tuple-to-string-python-example-code\/","url_meta":{"origin":18580,"position":5},"title":"Convert tuple to string Python | Example code","author":"Rohit","date":"October 11, 2021","format":false,"excerpt":"Use str join() method or for loop to Convert tuple to string Python. We will convert a tuple to a string concatenates each string in the tuple into a single string. Convert tuple to string Python exmaple Simple example code. Use str join() funciton Call the join(iterable) function with \"\"\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Convert tuple to string Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Convert-tuple-to-string-Python.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\/18580","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=18580"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/18580\/revisions"}],"predecessor-version":[{"id":18591,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/18580\/revisions\/18591"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=18580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=18580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=18580"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=18580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}