{"id":17741,"date":"2021-08-12T10:06:34","date_gmt":"2021-08-12T04:36:34","guid":{"rendered":"https:\/\/tutorial.eyehunts.com\/?p=17741"},"modified":"2021-11-02T18:13:06","modified_gmt":"2021-11-02T12:43:06","slug":"start-stop-step-python-slice-parameters","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/","title":{"rendered":"Start Stop Step Python | slice() Parameters"},"content":{"rendered":"\n<p>The <a href=\"https:\/\/tutorial.eyehunts.com\/js\/slice-method-in-javascript-used-slice-the-string-and-array\/\">slice method<\/a> has 3 notations &#8211; Start Stop Step in Python. <strong>slice(start: stop[: step])<\/strong> is an object usually containing a portion of a sequence. This function can be used to slice <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-tuples-tuorial-example\/\">tuples<\/a>, <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-arrays-declaration-method-example\/\">arrays<\/a>, <a href=\"https:\/\/tutorial.eyehunts.com\/python\/reverse-a-word-in-python-letters-in-word-and-sentences\/\">sentences<\/a>, and <a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-lists-tutorial-example\/\">lists<\/a>.<\/p>\n\n\n\n<p>Here is the syntax of the slice() method. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>slice(start, stop, step)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>start<\/strong> (<strong>optional<\/strong>)- Starting index value where the slicing of the object starts. Default to 0 if not provided.<\/li><li><strong>stop <\/strong>&#8211; Index value until which the slicing takes place.<\/li><li><strong>step (optional)<\/strong> &#8211; Index value steps between each index for slicing. Defaults to 1 if not provided.<\/li><\/ul>\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 Start Stop Step Python<\/strong><\/h2>\n\n\n\n<p>Here is a Python example of the slice method with the Start, Stop, and Step Arguments (Parameters).<\/p>\n\n\n\n<p>If the only stop is provided, it generates a portion of sequence from index 0 till stop <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = &#91;1, 2, 3, 4, 5, 6, 7, 8]\nprint(a&#91;:5])\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=\"272\" height=\"116\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg?resize=272%2C116&#038;ssl=1\" alt=\"Start Stop Step Python\" class=\"wp-image-17849\"\/><\/figure><\/div>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If only start is provided, it generates a portion of the sequence after an index starts till the last element.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = &#91;1, 2, 3, 4, 5, 6, 7, 8]\nprint(a&#91;3:])\n<\/code><\/pre>\n\n\n\n<p>Output: [4, 5, 6, 7, 8]<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If both start and stop are provided, it generates a portion of the sequence after the index starts till the stop.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = &#91;1, 2, 3, 4, 5, 6, 7, 8]\nprint(a&#91;3:5])\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: [4, 5]<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If all three starts, stop, and step are provided, it generates a portion of the sequence after the index starts till the stop with an increment of the index step.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>a = &#91;1, 2, 3, 4, 5, 6, 7, 8]\nprint(a&#91;3:7:2])\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: [4, 6]<\/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 these Python slice notations.<\/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>The slice method has 3 notations &#8211; Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a sequence. This function can be used to slice tuples, arrays, sentences, and lists. Here is the syntax of the slice() method. start (optional)- Starting index value where the slicing of the&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Start Stop Step Python | slice() Parameters<\/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":[102],"post_series":[],"class_list":["post-17741","post","type-post","status-publish","format-standard","hentry","category-python","tag-python-slice"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Start Stop Step Python | slice() Parameters - EyeHunts<\/title>\n<meta name=\"description\" content=\"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq\" \/>\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\/start-stop-step-python-slice-parameters\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Start Stop Step Python | slice() Parameters - EyeHunts\" \/>\n<meta property=\"og:description\" content=\"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-12T04:36:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-02T12:43:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg\" \/>\n<meta name=\"author\" content=\"Rohit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/\",\"name\":\"Start Stop Step Python | slice() Parameters - EyeHunts\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg\",\"datePublished\":\"2021-08-12T04:36:34+00:00\",\"dateModified\":\"2021-11-02T12:43:06+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg?fit=272%2C116&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg?fit=272%2C116&ssl=1\",\"width\":272,\"height\":116},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Start Stop Step Python | slice() Parameters\"}]},{\"@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":"Start Stop Step Python | slice() Parameters - EyeHunts","description":"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq","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\/start-stop-step-python-slice-parameters\/","og_locale":"en_US","og_type":"article","og_title":"Start Stop Step Python | slice() Parameters - EyeHunts","og_description":"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq","og_url":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/","og_site_name":"Tutorial","article_published_time":"2021-08-12T04:36:34+00:00","article_modified_time":"2021-11-02T12:43:06+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg","type":"","width":"","height":""}],"author":"Rohit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/","url":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/","name":"Start Stop Step Python | slice() Parameters - EyeHunts","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg","datePublished":"2021-08-12T04:36:34+00:00","dateModified":"2021-11-02T12:43:06+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"The slice method has 3 notations - Start Stop Step in Python. slice(start: stop[: step]) is an object usually containing a portion of a seq","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#primaryimage","url":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg?fit=272%2C116&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/Start-Stop-Step-Python.jpg?fit=272%2C116&ssl=1","width":272,"height":116},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/start-stop-step-python-slice-parameters\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"Start Stop Step Python | slice() Parameters"}]},{"@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":8580,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-slice-function-1-shorthand-array-list-tuple-string\/","url_meta":{"origin":17741,"position":0},"title":"Python slice Function |::-1 shorthand, (Array, List, Tuple, String)","author":"Rohit","date":"May 25, 2020","format":false,"excerpt":"Python slice function returns a slice object that can use used to slice strings, lists(Array), tuple, etc. Means slice object is used to specify how to slice a sequence like strings,\u00a0lists,\u00a0tuples. Syntax slice(start, stop, step) Parameters start \u00a0- The slicing of the object starts. Optional and Default is NONE.stop\u00a0- The\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-list-slice.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-list-slice.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-list-slice.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-list-slice.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":17737,"url":"https:\/\/tutorial.eyehunts.com\/python\/understanding-slice-notation-python-use-an-example\/","url_meta":{"origin":17741,"position":1},"title":"Understanding slice notation Python | Use an example","author":"Rohit","date":"August 10, 2021","format":false,"excerpt":"It's pretty simple to understand slice notation in Python. The basic slicing technique is to define the starting point, the stopping point, and the step size. The slicing operator [] is actually being used in the above code with a slice() object using the : notation (which is only valid\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"slice notation Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/slice-notation-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/slice-notation-Python.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/08\/slice-notation-Python.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":8584,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-slice-string-function-get-range-characters-substring\/","url_meta":{"origin":17741,"position":2},"title":"Python slice string Function| Get a range of characters (SubString)","author":"Rohit","date":"May 24, 2020","format":false,"excerpt":"You can get a range of characters(substring) by using the slice function. Python slice() function returns a slice object that can use used to slice strings, lists, tuples. You have to Specify the parameters- start index and the end index, separated by a colon, to return a part of the\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-slice-string-Function-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-slice-string-Function-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-slice-string-Function-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-slice-string-Function-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":17733,"url":"https:\/\/tutorial.eyehunts.com\/python\/slice-operator-in-python-basics\/","url_meta":{"origin":17741,"position":3},"title":"Slice operator in Python | Basics","author":"Rohit","date":"November 10, 2021","format":false,"excerpt":"Slice operators are nothing bracket [] used with 3 values to slice string, tuple, or list in Python. The three-parameter is used in the slice operator is:- start = include everything STARTING AT this idx (inclusive) stop = include everything BEFORE this idx (exclusive) step = (can be ommitted) difference\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Slice operator in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/11\/Slice-operator-in-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":8582,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-list-slice-get-specific-sets-of-sub-elements\/","url_meta":{"origin":17741,"position":4},"title":"Python list slice | Get specific sets of sub-elements Array","author":"Rohit","date":"May 24, 2020","format":false,"excerpt":"As you know Python List\u00a0is a collection that is ordered and changeable. if you don't know then you must read the first Python List tutorial. Python List Slicing is a way to get a range of items in a\u00a0list. Note: List are index from 0 to size-1, with a step\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-list-slice-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-list-slice-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-list-slice-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/05\/Python-list-slice-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":17720,"url":"https:\/\/tutorial.eyehunts.com\/python\/string-slicing-in-python-example-code\/","url_meta":{"origin":17741,"position":5},"title":"String slicing in Python | Example code","author":"Rohit","date":"November 8, 2021","format":false,"excerpt":"Getting a substring from a given string is called String slicing in Python. A simple way to do this is to use the simple slicing operator. Python string slicing can be done in two ways. slice() Constructor Extending Indexing Example String slicing in Python A simple example code demonstrates string\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"String slicing in Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/11\/String-slicing-in-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\/17741","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=17741"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/17741\/revisions"}],"predecessor-version":[{"id":21835,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/17741\/revisions\/21835"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=17741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=17741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=17741"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=17741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}