{"id":75147,"date":"2020-01-13T11:31:57","date_gmt":"2020-01-13T06:01:57","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=75147"},"modified":"2020-01-13T11:31:57","modified_gmt":"2020-01-13T06:01:57","slug":"python-sequences","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/","title":{"rendered":"Python Sequences &#8211;  Types, Operations, and Functions"},"content":{"rendered":"<p>Today, we are going to learn about the different Python data structures.<\/p>\n<p>They can be divided into two categories based on the ordering of items: <strong>Sequences<\/strong> and <strong>Collections<\/strong>. Elements in sequences <strong>come out<\/strong> in the <strong>same<\/strong> <strong>order<\/strong> as it is <strong>inserted<\/strong>, however <strong>ordering <\/strong>in collections is <strong>not preserved<\/strong>.<\/p>\n<p>In this article, we will focus only on <strong>sequences<\/strong>. So, let\u2019s get started.<\/p>\n<h3>Python Sequences<\/h3>\n<p>In Python programming, sequences are a <strong>generic term<\/strong> for an <strong>ordered set<\/strong> which means that the order in which we <strong>input<\/strong> the items will be the same when we <strong>access<\/strong> them.<\/p>\n<p>Python supports <strong>six<\/strong> different types of sequences. These are <strong>strings<\/strong>, <strong>lists<\/strong>, <strong>tuples<\/strong>, <strong>byte<\/strong> <strong>sequences<\/strong>, <strong>byte arrays<\/strong>, and <strong>range objects<\/strong>. We will discuss each of them.<\/p>\n<h3>Types of Python Sequences<\/h3>\n<h4>Python Strings<\/h4>\n<p>Strings are a <strong>group of characters<\/strong> written inside a <strong>single or double-quote<\/strong>s. Python does not have a <strong>character type<\/strong> so a single character inside quotes is also considered as a <strong>string<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">name = \u201cTechVidvan\u201d\ntype(name)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">&lt;class \u2018str\u2019&gt;<\/div>\n<p>Strings are <strong>immutable<\/strong> in nature so we can <strong>reassign<\/strong> a variable to a new string but we <strong>can\u2019t<\/strong> make any <strong>changes<\/strong> in the <strong>string<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">city= \u2018China\u2019\nprint(city[2])\ncity[2] = \u2018a\u2019<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Traceback (most recent call last):<br \/>\n<span style=\"font-weight: 400\">\u00a0\u00a0<\/span>File &#8220;&lt;stdin&gt;&#8221;, line 3, in &lt;module&gt;<br \/>\nTypeError: &#8216;str&#8217; object does not support item assignment<\/div>\n<h4>Python Lists<\/h4>\n<p>Python lists are similar to an array but they allow us to <strong>create<\/strong> a <strong>heterogeneous collection<\/strong> of items inside a <strong>list<\/strong>. A list can contain <strong>numbers<\/strong>, <strong>strings<\/strong>, <strong>lists<\/strong>, <strong>tuples<\/strong>, <strong>dictionaries<\/strong>, <strong>objects<\/strong>, etc.<\/p>\n<p>Lists are declared by using <strong>square brackets<\/strong> around <strong>comma-separated<\/strong> items.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">list1 = [1,2,3,4]\nlist2 = [\u2018red\u2019, \u2018green\u2019, \u2018blue\u2019]\nlist3 = [\u2018hello\u2019, 100, 3.14, [1,2,3] ]<\/pre>\n<p><strong>Lists<\/strong> are <strong>mutable<\/strong> which makes it easier to <strong>change<\/strong> and we can quickly <strong>modify<\/strong> a list by directly <strong>accessing<\/strong> it.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">list = [10,20,30,40]\nlist[1] = 100\nprint( list)<\/pre>\n<p><strong>Output: <\/strong><\/p>\n<div class=\"code-output\">[10, 100, 30, 40]<\/div>\n<h4>Python Tuples<\/h4>\n<p>Tuples are also a <strong>sequence<\/strong> of <strong>Python objects<\/strong>. A tuple is created by <strong>separating<\/strong> items with a <strong>comma<\/strong>. They can be optionally put inside the<strong> parenthesis ()<\/strong> but it is necessary to put parenthesis in an <strong>empty tuple<\/strong>.<\/p>\n<p>A <strong>single item tuple<\/strong> should use a<strong> comma<\/strong> in the end.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">tup = ()\nprint( type(tup) )\ntup = (1,2,3,4,5)\ntup = ( \u201c78 Street\u201d, 3.8, 9826 )\nprint(tup)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">&lt;class \u2018tuple\u2019&gt;<br \/>\n(&#8217;78 Street&#8217;, 3.8, 9826)<\/div>\n<p>Tuples are also <strong>immutable<\/strong> like <strong>strings<\/strong> so we can only <strong>reassign<\/strong> the <strong>variable<\/strong> but we cannot <strong>change<\/strong>, <strong>add<\/strong> or <strong>remove elements<\/strong> from the <strong>tuple<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">tup = (1,2,3,4,5)\ntup[2] = 10<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Traceback (most recent call last):<br \/>\n<span style=\"font-weight: 400\">\u00a0\u00a0<\/span>File &#8220;&lt;stdin&gt;&#8221;, line 2, in &lt;module&gt;<br \/>\nTypeError: &#8216;tuple&#8217; object does not support item assignment<\/div>\n<h4>Bytes Sequences in Python<\/h4>\n<p>The <strong>bytes()<\/strong> function in Python is used to <strong>return<\/strong> an <strong>immutable<\/strong> <strong>bytes sequence<\/strong>. Since they are immutable, we cannot <strong>modify<\/strong> them.<\/p>\n<p>If you want a <strong>mutable byte sequence<\/strong>, then it is better to use <strong>byte arrays<\/strong>. This is how we can create a byte of a given <strong>integer size<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">size = 10\nb = bytes(size)\nprint( b )<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">b&#8217;\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00&#8242;<\/div>\n<p>Iterables can be converted into <strong>bytes<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">print( bytes([4,2,1]) )<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">b&#8217;\\x04\\x02\\x01&#8242;<\/div>\n<p>For strings, we have to provide the <strong>encoding<\/strong> in the <strong>second parameter<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">bytes(\u201cHey\u201d, \u2018utf=8\u2019)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">b\u2019Hey\u2019<\/div>\n<h4>Byte Arrays in Python<\/h4>\n<p>Byte arrays are <strong>similar<\/strong> to <strong>bytes sequence<\/strong>. The only difference here is that byte arrays are <strong>mutable<\/strong> while bytes sequences are <strong>immutable<\/strong>. So, it also <strong>returns<\/strong> the <strong>bytes object<\/strong> the same way.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">print( bytearray(4) )\nprint( bytearray([1, 2, 3, 4]) )\nprint( bytearray(\u2018Hola!\u2019, \u2018utf-8\u2019))<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">bytearray(b&#8217;\\x00\\x00\\x00\\x00&#8242;)<br \/>\nbytearray(b&#8217;\\x01\\x02\\x03\\x04&#8242;)<br \/>\nbytearray(b&#8217;Hola!&#8217;)<\/div>\n<p>Since byte arrays are <strong>mutable<\/strong>, let\u2019s try changing a <strong>byte<\/strong> from the <strong>array<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">a = bytearray([1,3,4,5])\nprint(a)\na[2] = 2\nprint(a)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">bytearray(b&#8217;\\x01\\x03\\x04\\x05&#8242;)<br \/>\nbytearray(b&#8217;\\x01\\x03\\x02\\x05&#8242;)<\/div>\n<h4>Python range() objects<\/h4>\n<p><strong>range()<\/strong> is a built-in function in Python that returns us a <strong>range object<\/strong>. The range object is nothing but a <strong>sequence of integers<\/strong>. It generates the integers within the specified <strong>start<\/strong> and <strong>stop range<\/strong>.<\/p>\n<p>Let\u2019s see this with an example.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">num = range(10)\nprint( type(num) )<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">&lt;class \u2018range\u2019&gt;<\/div>\n<p>Since range object generates <strong>integers<\/strong>, we can access them by iterating using a <strong>for loop<\/strong>.<\/p>\n<p><strong>Code: <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">for i in range(5):\n  print(i)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">0<br \/>\n1<br \/>\n2<br \/>\n3<br \/>\n4<\/div>\n<p>The first argument is the <strong>starting range<\/strong>, the second argument is the <strong>stopping range<\/strong> and the third argument tells how many <strong>steps to take<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">for i in range(4,16,2):\n  print()<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">4<br \/>\n6<br \/>\n8<br \/>\n10<br \/>\n12<br \/>\n14<\/div>\n<h3>Operations on Python Sequences<a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/operations-on-python-sequences.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-75450 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/operations-on-python-sequences.jpg\" alt=\"python sequences operations\" width=\"682\" height=\"350\" \/><\/a><\/h3>\n<p>Let\u2019s discuss the operations we can perform on the sequences.<\/p>\n<h4>1. Concatenation<\/h4>\n<p>The <strong>operator (+)<\/strong> is used to <strong>concatenate<\/strong> the <strong>second element<\/strong> to the <strong>first<\/strong>.<\/p>\n<p><strong>For example<\/strong> <strong>&#8211;<\/strong> [1,3,4] + [1,1,1] will evaluate to [1,3,4,1,1,1].<\/p>\n<p>We can <strong>concate<\/strong> all other <strong>sequences<\/strong> like this.<\/p>\n<h4>2. Repeat<\/h4>\n<p>The <strong>operator (*)<\/strong> is used to <strong>repeat<\/strong> a sequence <strong>n number of times<\/strong>.<\/p>\n<p><strong>For example &#8211;<\/strong> (1,2,3) * 3 will evaluate to (1,2,3,1,2,3,1,2,3).<\/p>\n<p>This also works on <strong>sequences<\/strong> other than <strong>tuples<\/strong>.<\/p>\n<h4>3. Membership Operators<\/h4>\n<p>Membership operators<strong> (in)<\/strong> and <strong>(not in)<\/strong> are used to check <strong>whether<\/strong> an item is <strong>present<\/strong> in the <strong>sequence<\/strong> or <strong>not<\/strong>. They return <strong>True<\/strong> or <strong>False<\/strong>.<\/p>\n<p><strong>For example &#8211;<\/strong> \u2018la\u2019 in \u201cManilla\u201d evaluates to True and \u2018a\u2019 not in \u2018all\u2019 evaluates to False.<\/p>\n<h4>4. Slicing Operator<\/h4>\n<p>All the sequences in Python can be <strong>sliced<\/strong>. The slicing operator can <strong>take out<\/strong> a <strong>part<\/strong> of a <strong>sequence<\/strong> from the sequence.<\/p>\n<p><strong>For example &#8211;<\/strong><\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">print( \"The new york times\"[4:10] )\nprint( (1,2,3,4,5)[1:3] )<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">\u2018new yo\u2019<br \/>\n(2,3)<\/div>\n<h3>Python Sequence Functions<a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/python-sequence-functions.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-75451 size-full\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2020\/01\/python-sequence-functions.jpg\" alt=\"functions of python sequences\" width=\"632\" height=\"350\" \/><\/a><\/h3>\n<p>Let us discuss some of the useful functions we can use on sequences.<\/p>\n<h4>1. len()<\/h4>\n<p>The <strong>len()<\/strong> function is very handy when you want to know the <strong>length<\/strong> of the <strong>sequence<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">len(\u201cThis is a sentence\u201d)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">18<\/div>\n<h4>2. min() and max()<\/h4>\n<p>The <strong>min()<\/strong> and <strong>max()<\/strong> functions are used to get the <strong>minimum<\/strong> <strong>value<\/strong> and the <strong>maximum<\/strong> <strong>value<\/strong> from the <strong>sequences respectively<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">print(min([5,3,2,1]))\nprint(max([5,3,2,1]))<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">1<br \/>\n5<\/div>\n<h4>3. index()<\/h4>\n<p>The<strong> index()<\/strong> method <strong>searches<\/strong> an <strong>element<\/strong> in the <strong>sequence<\/strong> and <strong>returns<\/strong> the <strong>index<\/strong> of the <strong>first occurrence<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\u201cHahaha\u201d.index(\u201ca\u201d)<\/pre>\n<p><strong>Output: <\/strong><\/p>\n<div class=\"code-output\">1<\/div>\n<h4>4. count()<\/h4>\n<p>The <strong>count()<\/strong> method counts the <strong>number of times<\/strong> an element has occurred in the <strong>sequence<\/strong>.<\/p>\n<p><strong>Code:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\u201cHahaha\u201d.count(\u201ca\u201d)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">3<\/div>\n<h3>Summary<\/h3>\n<p>In this article, we have seen the <strong>Python sequences<\/strong>. We learned about the six different types of sequences: <strong>strings<\/strong>, <strong>lists<\/strong>, <strong>tuples<\/strong>, <strong>byte<\/strong> <strong>sequences<\/strong>,<strong> byte arrays<\/strong>, and <strong>range objects<\/strong>.<\/p>\n<p>We saw examples of each sequence on how to <strong>create<\/strong> them, then <strong>learned<\/strong> about the <strong>operations<\/strong> and <strong>functions associated<\/strong> with them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are going to learn about the different Python data structures. They can be divided into two categories based on the ordering of items: Sequences and Collections. Elements in sequences come out in&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":75452,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[1293,1294,1295,1173,1296,1297,1298,1157,1185,1299,1300],"class_list":["post-75147","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-byte-arrays-in-python","tag-bytes-sequences-in-python","tag-operations-on-python-sequences","tag-python-lists","tag-python-range-objects","tag-python-sequence-functions","tag-python-sequences","tag-python-strings","tag-python-tuples","tag-sequences-in-python","tag-types-of-python-sequences"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Sequences - Types, Operations, and Functions - TechVidvan<\/title>\n<meta name=\"description\" content=\"Python Sequences - Learn the concept of sequences in Python, its types such as Python strings, lists, tuples, etc with its functions &amp; operations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-sequences\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Sequences - Types, Operations, and Functions - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Python Sequences - Learn the concept of sequences in Python, its types such as Python strings, lists, tuples, etc with its functions &amp; operations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-sequences\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-13T06:01:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Sequences - Types, Operations, and Functions - TechVidvan","description":"Python Sequences - Learn the concept of sequences in Python, its types such as Python strings, lists, tuples, etc with its functions & operations.","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:\/\/techvidvan.com\/tutorials\/python-sequences\/","og_locale":"en_US","og_type":"article","og_title":"Python Sequences - Types, Operations, and Functions - TechVidvan","og_description":"Python Sequences - Learn the concept of sequences in Python, its types such as Python strings, lists, tuples, etc with its functions & operations.","og_url":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-01-13T06:01:57+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Python Sequences &#8211; Types, Operations, and Functions","datePublished":"2020-01-13T06:01:57+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/"},"wordCount":951,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg","keywords":["Byte Arrays in Python","Bytes Sequences in Python","Operations on Python Sequences","python lists","Python range() objects","Python Sequence Functions","Python Sequences","python strings","python tuples","sequences in python","Types of Python Sequences"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-sequences\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/","url":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/","name":"Python Sequences - Types, Operations, and Functions - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg","datePublished":"2020-01-13T06:01:57+00:00","description":"Python Sequences - Learn the concept of sequences in Python, its types such as Python strings, lists, tuples, etc with its functions & operations.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-sequences\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/01\/python-sequences.jpg","width":802,"height":420,"caption":"sequences in python"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-sequences\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Python Sequences &#8211; Types, Operations, and Functions"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/75147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=75147"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/75147\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/75452"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=75147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=75147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=75147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}