{"id":3657,"date":"2023-08-21T01:47:07","date_gmt":"2023-08-21T08:47:07","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=3657"},"modified":"2024-01-31T07:03:00","modified_gmt":"2024-01-31T14:03:00","slug":"python-substring-quick-reference","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/python-substring-quick-reference\/","title":{"rendered":"Python Substring Quick Reference"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2023\/08\/Artistic-digital-illustration-of-Python-code-implementing-a-substring-method-showcasing-string-manipulation-techniques-300x300.jpg\" alt=\"Artistic digital illustration of Python code implementing a substring method showcasing string manipulation techniques\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Has Python&#8217;s string manipulation ever left you feeling like you&#8217;re navigating a maze? Have you wished for an easier way to extract specific character sequences? If so, you&#8217;re in the right place. This blog post will demystify Python&#8217;s string manipulation, focusing particularly on substring extraction.<\/p>\n<p>Whether you&#8217;re a Python novice or a seasoned coder looking for a refresher, this comprehensive guide will equip you with the skills to extract substrings in Python effectively. By the end of this post, you&#8217;ll be slicing through strings with the precision of a master chef.<\/p>\n<h2>TL;DR: How do I extract a substring in Python?<\/h2>\n<blockquote><p>\n  To extract a substring in Python, you typically use the <a href=\"https:\/\/ioflood.com\/blog\/string-slicing-in-python-usage-and-examples\/\">slicing method<\/a>. You can also use Python&#8217;s built-in string methods like <code>find()<\/code>, <code>index()<\/code>, <code>split()<\/code>, etc, depending on what you wish to achieve.\n<\/p><\/blockquote>\n<p>Here is how you do it with slicing:<\/p>\n<pre><code class=\"language-python line-numbers\"># given string s\ns = \"Hello, World!\"\n\n# get the substring from index 2 to index 5 (exclusive)\nsub_str = s[2:5]\nprint(sub_str)\n# Output: llo\n<\/code><\/pre>\n<p>Remember, Python indexing starts at 0, so index 2 is the third character and slicing is exclusive of the end index.<\/p>\n<h2>Introduction to Substrings<\/h2>\n<p>A substring is a portion of a string. It can be as short as a single character or as long as the entire string itself. Substring extraction is a key skill in string manipulation, and Python offers several built-in methods to do this effectively.<\/p>\n<p>Python offers a variety of ways to extract substrings from a string. One of the most intuitive methods is through slicing.<\/p>\n<h2>Python String Slicing<\/h2>\n<p>In Python, <a href=\"https:\/\/ioflood.com\/blog\/string-slicing-in-python-usage-and-examples\/\">slicing<\/a> allows you to extract a section of a sequence, such as a string. It&#8217;s akin to taking a slice from a cake. You specify where your slice starts and ends, and Python hands you the piece.<\/p>\n<p>The syntax for slicing in Python is <code>sequence[start:stop:step]<\/code>. Here&#8217;s how it works:<\/p>\n<ul>\n<li><code>start<\/code>: The index where the slice starts. If omitted, it defaults to 0, which is the beginning of the string.<\/li>\n<li><code>stop<\/code>: The index where the slice ends. This index is not included in the slice. If omitted, it defaults to the length of the string.<\/li>\n<li><code>step<\/code>: The amount by which the index increases. If omitted, it defaults to 1. If the step value is negative, the slicing goes from right to left.<\/li>\n<\/ul>\n<p>Here&#8217;s a basic example:<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nsubstring = string[0:5]\nprint(substring)  # Outputs: Hello\n<\/code><\/pre>\n<p>This code extracts the first five characters from the string, forming the substring &#8216;Hello&#8217;.<\/p>\n<p>Example of slicing with a step value:<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nsubstring = string[::2]\nprint(substring)  # Outputs: 'Hlo yhn'\n<\/code><\/pre>\n<p>The &#8220;2&#8221; in the step above means it will increment forward by 2 characters each time it extracts a character &#8212; in effect, skipping every other character.<\/p>\n<h3>Examples of Substring Extraction<\/h3>\n<p>Let&#8217;s explore a few more examples of substring extraction in different scenarios.<\/p>\n<h4>Extracting the first n characters from a string:<\/h4>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nsubstring = string[:5]\nprint(substring)  # Outputs: Hello\n<\/code><\/pre>\n<h4>Extracting the last n characters from a string:<\/h4>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nsubstring = string[-1:]\nprint(substring)  # Outputs: !\n<\/code><\/pre>\n<h4>Extracting a substring between two known substrings:<\/h4>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nstart = string.find('Hello') + len('Hello')\nend = string.find('Python')\nsubstring = string[start:end].strip()\nprint(substring)  # Outputs: ,\n<\/code><\/pre>\n<h3>Substring Extraction: Important Considerations<\/h3>\n<p>While working with substrings, remember that Python string indices start at 0. Also, in Python, strings are immutable, meaning they can&#8217;t be changed after they&#8217;re created. So, any operation that manipulates a string will actually create a new string.<\/p>\n<p>Example of string immutability:<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nstring[0] = 'h'  # Raises a TypeError\n<\/code><\/pre>\n<h2>Other Methods for Substring Extraction<\/h2>\n<p>Beyond slicing, Python also offers several built-in methods for substring extraction, such as <code>find()<\/code>, <a href=\"https:\/\/ioflood.com\/blog\/python-get-index-of-item-in-list\/\"><code>index()<\/code><\/a>, and <a href=\"https:\/\/ioflood.com\/blog\/python-split\/\"><code>split()<\/code><\/a>.<\/p>\n<h3>Find()<\/h3>\n<p>The <code>find()<\/code> method returns the index of the first occurrence of the specified substring. If the substring is not found, it returns -1.<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nindex = string.find('Python')\nprint(index)  # Outputs: 7\n<\/code><\/pre>\n<h3>Index()<\/h3>\n<p>The <code>index()<\/code> method is similar to <code>find()<\/code>, but raises an exception if the substring is not found.<\/p>\n<p>Example of using the <code>index()<\/code> method:<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nindex = string.index('Python')\nprint(index)  # Outputs: 7\n<\/code><\/pre>\n<h3>Split()<\/h3>\n<p>The <code>split()<\/code> method splits a string into a list where each word is a list item. You can specify the separator; the default separator is any whitespace.<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python!\"\nwords = string.split()\nprint(words)  # Outputs: ['Hello,', 'Python!']\n<\/code><\/pre>\n<h2>Efficiency of Substring Extractions<\/h2>\n<p>The efficiency of a substring extraction method depends on the specific requirements of your task. Slicing is a fast and efficient method for extracting substrings when you know the start and end indices. But if you need to find the position of a substring within a string, methods like <code>find()<\/code> and <code>index()<\/code> are more suitable.<\/p>\n<p>Example of comparing the performance of slicing and the <code>find()<\/code> method:<\/p>\n<pre><code class=\"language-python line-numbers\">import time\n\n# The '*' operator concatenates the string 'Hello, Python!' 10,000 times\nstring = 'Hello, Python!' * 10000\n\n# We'll run each command 1,000 times in a loop\nrepeat_count = 1000\n\nstart = time.time()\nfor _ in range(repeat_count):\n    substring = string[0:5]\nend = time.time()\nprint('Slicing:', end - start)\n\nstart = time.time()\nfor _ in range(repeat_count):\n    index = string.find('Python')\nend = time.time()\nprint('find():', end - start)\n<\/code><\/pre>\n<p>If you run the above code, you can get an idea for the time it takes for each method.<\/p>\n<p>In terms of performance, Python&#8217;s built-in string methods are implemented in C, making them highly efficient.<\/p>\n<h2>Python String Manipulation Basics<\/h2>\n<p>Now that you&#8217;ve learned about Substrings, it may be helpful to get a broader view on String operations in Python more generally.<\/p>\n<p>In Python, a string is a series of characters enclosed in single (<code>'Hello'<\/code>) or double quotes (<code>\"Hello\"<\/code>). Strings are one of the most frequently used data types in Python, boasting a multitude of built-in methods for text data manipulation.<\/p>\n<pre><code class=\"language-python line-numbers\">example_string = \"Hello, Python!\"\nprint(example_string)\n<\/code><\/pre>\n<p>Executing the above code will output: <code>Hello, Python!<\/code><\/p>\n<p>Python strings are not just sequences of characters; they&#8217;re versatile tools that can be manipulated in numerous ways. Here are some basic operations you can perform on strings:<\/p>\n<table>\n<thead>\n<tr>\n<th>Operation<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><a href=\"https:\/\/ioflood.com\/blog\/append-to-string-python\/\">Concatenation<\/a><\/td>\n<td>Joins two or more strings together<\/td>\n<\/tr>\n<tr>\n<td>Repetition<\/td>\n<td>Repeats a string a specified number of times<\/td>\n<\/tr>\n<tr>\n<td>Indexing<\/td>\n<td>Accesses a character at a specific position in the string<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/ioflood.com\/blog\/python-regex\/\">Regular Expressions<\/a><\/td>\n<td>Also known as &#8220;regex&#8221;, these allow for flexible pattern matching and substitution with strings<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Slicing<\/h3>\n<p>This operation extracts a part of the string.<\/p>\n<p>Here&#8217;s an example of how you can extract substrings from a Python string using slicing:<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello, Python\"\n# Slicing from 3rd to 7th character\nsubstring = string[2:7]\nprint(substring)  # Outputs: llo,\n<\/code><\/pre>\n<h3>Concatenation<\/h3>\n<p>This operation joins two or more strings together.<\/p>\n<pre><code class=\"language-python line-numbers\">string1 = \"Hello\"\nstring2 = \"Python\"\nprint(string1 + string2)  # Outputs: HelloPython\n<\/code><\/pre>\n<h3>Repetition<\/h3>\n<p>This operation repeats a string a specified number of times.<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello\"\nprint(string * 3)  # Outputs: HelloHelloHello\n<\/code><\/pre>\n<h3>Indexing<\/h3>\n<p>This operation accesses a character at a specific position in the string.<\/p>\n<pre><code class=\"language-python line-numbers\">string = \"Hello\"\nprint(string[1])  # Outputs: e\n<\/code><\/pre>\n<h3>Inserting Variables into Strings: String Formatting<\/h3>\n<p>Python provides several ways to <a href=\"https:\/\/ioflood.com\/blog\/python-string-format\/\">format strings<\/a>, enabling you to insert variables into strings and format them in various ways. The <code>format()<\/code> method is a versatile tool for string formatting. It replaces placeholders &#8211; denoted by <code>{}<\/code> &#8211; in the string with its arguments.<\/p>\n<p>Example of string formatting using f-strings with the <code>format()<\/code> command:<\/p>\n<pre><code class=\"language-python line-numbers\">name = 'Python'\nstring = 'Hello, {}!'.format(name)\nprint(string)  # Outputs: Hello, Python!\n<\/code><\/pre>\n<p>Python 3.6 introduced f-strings, a new way of formatting strings that&#8217;s more concise and readable than the <code>format()<\/code> method.<\/p>\n<pre><code class=\"language-python line-numbers\">name = 'Python'\nstring = f'Hello, {name}!'\nprint(string)  # Outputs: Hello, Python!\n<\/code><\/pre>\n<h3>Regular Expressions for Powerful String Manipulation<\/h3>\n<p>Regular expressions, or regex, are a potent tool for string manipulation. They offer a flexible and efficient way to search, replace, and extract information from strings. Python&#8217;s <code>re<\/code> module supports regular expressions, providing a robust platform for complex string manipulations.<\/p>\n<p>When it comes to substring extraction, regular expressions come into their own when you want to extract a substring that matches a specific pattern.<\/p>\n<p>For instance, you may need to extract all email addresses from a text or all dates in a particular format. Let&#8217;s look at an example of using regular expressions to extract substrings in Python:<\/p>\n<pre><code class=\"language-python line-numbers\">import re\n\nstring = \"The rain in Spain\"\nsubstring = re.findall(\"ai\", string)\nprint(substring)  # Outputs: ['ai', 'ai']\n<\/code><\/pre>\n<p>In this example, the <code>re.findall()<\/code> method returns all occurrences of the pattern &#8216;ai&#8217; in the string.<\/p>\n<p>Regular expressions excel in complex substring extraction scenarios. For example, you might need to extract all the URLs from a webpage or all the hashtags from a social media post. Regular expressions make these tasks straightforward. Here&#8217;s an example of how to extract all the hashtags from a text:<\/p>\n<pre><code class=\"language-python line-numbers\">import re\n\ntext = \"#Python is awesome. #coding\"\nhashtags = re.findall(r\"#(w+)\", text)\nprint(hashtags)  # Outputs: ['Python', 'coding']\n<\/code><\/pre>\n<p>In this example, the regular expression <code>r\"#(w+)\"<\/code> matches any sequence of alphanumeric characters preceded by a hashtag.<\/p>\n<h2>Python&#8217;s In-Built String Methods<\/h2>\n<p>Python&#8217;s built-in string methods offer a robust set of tools for string manipulation. These include <a href=\"https:\/\/ioflood.com\/blog\/python-to-lowercase\/\"><code>lower()<\/code><\/a>, <code>upper()<\/code>, <code>split()<\/code>, <a href=\"https:\/\/ioflood.com\/blog\/python-string-replace\/\"><code>replace()<\/code><\/a>, <code>find()<\/code>, among others. See below for examples of the more commonly used built-in methods:<\/p>\n<h4>Strip()<\/h4>\n<p><a href=\"https:\/\/ioflood.com\/blog\/python-strip\/\"><code>strip()<\/code><\/a> ( and <a href=\"https:\/\/ioflood.com\/blog\/python-rstrip\/\">rstrip()<\/a> ) Removes leading and trailing whitespace from a string.<\/p>\n<pre><code class=\"language-python line-numbers\">string = '   Hello, Python!   '\nprint(string.strip())  # Outputs: 'Hello, Python!'\n<\/code><\/pre>\n<h4>Upper()<\/h4>\n<p><code>upper()<\/code> Converts a string to uppercase.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nprint(string.upper())  # Outputs: 'HELLO, PYTHON!'\n<\/code><\/pre>\n<h4>Lower()<\/h4>\n<p><code>lower()<\/code> Converts a string to lowercase.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nprint(string.lower())  # Outputs: 'hello, python!'\n<\/code><\/pre>\n<h4>StartsWith()<\/h4>\n<p><code>startswith()<\/code> Checks if a string starts with a specified substring.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nprint(string.startswith('Hello'))  # Outputs: True\n<\/code><\/pre>\n<h4>EndsWith()<\/h4>\n<p><code>endswith()<\/code> Checks if a string ends with a specified substring.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nprint(string.endswith('Python!'))  # Outputs: True\n<\/code><\/pre>\n<h4>Count()<\/h4>\n<p><a href=\"https:\/\/ioflood.com\/blog\/python-counter-quick-reference-guide\/\"><code>count()<\/code><\/a> Counts the number of occurrences of a substring in a string.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\nprint(string.count('o'))  # Outputs: 2\n<\/code><\/pre>\n<h4>Split()<\/h4>\n<p><code>split()<\/code> breaks up a string at the specified separator and returns a list of substrings.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\n# Split string at every space\nprint(string.split(' '))  # Outputs: ['Hello,', 'Python!']\n<\/code><\/pre>\n<h4>Replace()<\/h4>\n<p><code>replace()<\/code> replaces all occurrences of a substring in a string with another substring.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\n# Replace 'Hello' with 'Hi'\nprint(string.replace('Hello', 'Hi'))  # Outputs: 'Hi, Python!'\n<\/code><\/pre>\n<h4>Find()<\/h4>\n<p><code>find()<\/code> searches for a substring in a string and returns the index of the first occurrence. If the substring is not found, it returns -1.<\/p>\n<pre><code class=\"language-python line-numbers\">string = 'Hello, Python!'\n# Find the first occurrence of 'o'\nprint(string.find('o'))  # Outputs: 4\n<\/code><\/pre>\n<p>These are just a few examples of Python&#8217;s built-in string methods. By mastering these methods, you can perform a wide array of string manipulation tasks in Python with ease and efficiency.<\/p>\n<h2>Examples with Other Languages<\/h2>\n<p>While Python string manipulation, particularly substring extraction, has been our main focus, it&#8217;s essential to note that string manipulation is a core aspect of almost all programming languages.<\/p>\n<p>However, the implementation of string manipulation, especially substring extraction, can significantly differ from one language to another. Let&#8217;s briefly examine how substring extraction is accomplished in some other popular programming languages.<\/p>\n<h3>Java<\/h3>\n<p>In Java, the <code>substring()<\/code> method is utilized to extract a substring from a string. It can accept one or two parameters: the start index, and optionally, the end index.<\/p>\n<pre><code class=\"language-java line-numbers\">String string = \"Hello, Java!\";\nString substring = string.substring(0, 5);\nSystem.out.println(substring);  \/\/ Outputs: Hello\n<\/code><\/pre>\n<h3>JavaScript<\/h3>\n<p>JavaScript also employs a <code>substring()<\/code> method for substring extraction. As in Java, you can specify the start and end indices.<\/p>\n<pre><code class=\"language-javascript line-numbers\">let string = \"Hello, JavaScript!\";\nlet substring = string.substring(0, 5);\nconsole.log(substring);  \/\/ Outputs: Hello\n<\/code><\/pre>\n<h3>C++<\/h3>\n<p>In C++, the <code>substr()<\/code> function is used to extract a substring. You specify the start index and the length of the substring.<\/p>\n<pre><code class=\"language-cpp line-numbers\">#include &lt;iostream&gt;\n#include &lt;string&gt;\n\nint main() {\n    std::string string = \"Hello, C++!\";\n    std::string substring = string.substr(0, 5);\n    std::cout &lt;&lt; substring &lt;&lt; std::endl;  \/\/ Outputs: Hello\n    return 0;\n}\n<\/code><\/pre>\n<h3>Ruby<\/h3>\n<p>Ruby employs the <code>slice()<\/code> method for substring extraction. You can specify the start index and the length of the substring, or provide a range.<\/p>\n<pre><code class=\"language-ruby line-numbers\">string = \"Hello, Ruby!\"\nsubstring = string.slice(0, 5)\nputs substring  # Outputs: Hello\n<\/code><\/pre>\n<p>As evident, while the method names and syntax may vary, the concept of substring extraction is a common thread across all these languages.<\/p>\n<blockquote><p>\n  Python&#8217;s approach, with its powerful slicing syntax and rich set of string methods, offers a particularly flexible and intuitive way to manipulate strings.\n<\/p><\/blockquote>\n<h3>Further Resources for Python Strings<\/h3>\n<p>If you&#8217;re interested in learning more ways to handle strings in Python, here are a few resources that you might find helpful:<\/p>\n<ul>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-string\/\">Revolutionizing Text Processing in Python with Strings<\/a>: Revolutionize your text processing skills in Python by mastering string methods and best practices outlined in this.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-strip\/\">Python Strip(): Removing Leading and Trailing Characters from a String<\/a>: Learn how to use the strip() method in Python to remove leading and trailing characters from a string, with examples and explanations of different use cases.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/python-match-case\/\">Python Match Case Statement: New Pattern Matching Syntax<\/a>: This article introduces the new match case statement in Python.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.freecodecamp.org\/news\/how-to-substring-a-string-in-python\/\" target=\"_blank\" rel=\"noopener\">How to Substring a String in Python<\/a>: An article on freeCodeCamp that explains different ways to extract substrings from a string in Python, with examples and explanations.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/python-string-substring\" target=\"_blank\" rel=\"noopener\">Python String Substring: Tutorial and Examples<\/a>: DigitalOcean provides a tutorial on Python string substring operations, covering various techniques to extract substrings from a string.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.simplilearn.com\/tutorials\/python-tutorial\/substring-in-python\" target=\"_blank\" rel=\"noopener\">Python substring() Method: Simplilearn Tutorial<\/a>: Simplilearn offers a tutorial on the substring() method in Python, explaining how to extract substrings from a string using this method.<\/p>\n<\/li>\n<\/ul>\n<h2>Wrapping Up<\/h2>\n<p>In this comprehensive guide, we&#8217;ve journeyed through the world of Python string manipulation, with a spotlight on substring extraction. We&#8217;ve untangled the different techniques to extract substrings in Python, from the straightforward slicing technique to the potent regular expressions, and the built-in string methods like <code>find()<\/code>, <code>index()<\/code>, and <code>split()<\/code>.<\/p>\n<p>Each method comes with its unique strengths and weaknesses. Slicing is quick and efficient for simple substring extraction tasks, but it demands knowledge of the start and end indices of the substring. Python&#8217;s built-in string methods provide a handy way to perform a variety of string manipulation tasks, including substring extraction. However, for complex substring extraction tasks that involve pattern matching, regular expressions are the go-to tool, despite their potential pitfalls and performance implications.<\/p>\n<p>But substring extraction is just one facet of string manipulation in Python. Python&#8217;s string manipulation capabilities extend far beyond that, encompassing a wide array of operations like concatenation, formatting, and various string methods. By mastering these capabilities, you can unlock the full potential of Python strings and significantly enhance your Python programming skills.<\/p>\n<p>We also took a swift detour to explore how substring extraction is handled in other popular programming languages, underscoring the flexibility and intuitiveness of Python&#8217;s approach to string manipulation.<\/p>\n<p>So, keep honing your string manipulation skills and happy Pythoning! Remember, extracting substrings in Python is like finding a specific book in a library. It might seem overwhelming at first, but once you know the system, it becomes a walk in the park.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Has Python&#8217;s string manipulation ever left you feeling like you&#8217;re navigating a maze? Have you wished for an easier way to extract specific character sequences? If so, you&#8217;re in the right place. This blog post will demystify Python&#8217;s string manipulation, focusing particularly on substring extraction. Whether you&#8217;re a Python novice or a seasoned coder looking [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":16715,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121,123],"tags":[],"class_list":["post-3657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-coding","category-python","cat-121-id","cat-123-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/3657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=3657"}],"version-history":[{"count":15,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/3657\/revisions"}],"predecessor-version":[{"id":16725,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/3657\/revisions\/16725"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/16715"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=3657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=3657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=3657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}