{"id":964,"date":"2023-01-07T15:33:00","date_gmt":"2023-01-07T10:03:00","guid":{"rendered":"https:\/\/geekpython.in\/?p=964"},"modified":"2023-08-15T14:33:15","modified_gmt":"2023-08-15T09:03:15","slug":"f-string-in-python","status":"publish","type":"post","link":"https:\/\/geekpython.in\/f-string-in-python","title":{"rendered":"F-String In Python &#8211; A Modern Way To Perform String Interpolation"},"content":{"rendered":"\n<p>String interpolation can be performed using multiple ways in Python. There are several methods provided by Python that can help us interpolate strings. Some of them are known as an old school or traditional way of formatting the string and some are added recently been added and gained so much popularity.<\/p>\n\n\n\n<p>One of the modern ways of interpolating the strings in Python is called&nbsp;<strong>f-string<\/strong>. First of all, what is string interpolation?&nbsp;<strong>String interpolation<\/strong>&nbsp;can be defined as assessing the string literal that contains one or more placeholders and replacing the placeholders with the corresponding values.<\/p>\n\n\n\n<p><strong>f-string<\/strong>&nbsp;was introduced in Python version 3.6 and proposed in the&nbsp;<a target=\"_blank\" href=\"https:\/\/peps.python.org\/pep-0498\/\" rel=\"noreferrer noopener\">PEP 498<\/a>&nbsp;to make the string formatting easier and easy to read. This improved the way how a string is formatted.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-f-string\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-f-string\"><\/a>f-string<\/h1>\n\n\n\n<p>f-string is also called&nbsp;<strong>Formatted String literal<\/strong>&nbsp;and is a convenient way to interpolate variables into the string. Unlike the other formatting methods that use the&nbsp;<code>%<\/code>&nbsp;operator and&nbsp;<code>.format()<\/code>&nbsp;method, the&nbsp;<strong>f-strings<\/strong>&nbsp;are prefixed with the letter&nbsp;<code>f<\/code>&nbsp;with the curly braces containing expressions that will be replaced by the corresponding values.<\/p>\n\n\n\n<p>The&nbsp;<code>f<\/code>&nbsp;in f-string can also stand for&nbsp;<strong>fast<\/strong>&nbsp;because of its better performance than the other formatting methods and it has several advantages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-advantages\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-advantages\"><\/a>Advantages<\/h2>\n\n\n\n<p>The big advantages of using f-strings are listed below:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Readability:<\/strong>&nbsp;F-strings are easier to read and write compared to other string formatting methods, such as the&nbsp;<code>%<\/code>&nbsp;operator and the&nbsp;<code>.format()<\/code>&nbsp;method. They allow us to include variables and expressions directly in the string literal, which makes the code more concise and expressive.<\/li>\n\n\n\n<li><strong>Flexibility:<\/strong>&nbsp;F-strings offer more flexibility and control over the formatting of interpolated values. We can specify a format specifier after the variable or expression in the curly braces to control how the value is formatted.<\/li>\n\n\n\n<li><strong>Performance:<\/strong>&nbsp;F-strings are faster than the&nbsp;<code>.format()<\/code>&nbsp;method and the&nbsp;<code>%<\/code>&nbsp;operator.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-syntax\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-syntax\"><\/a>Syntax<\/h2>\n\n\n\n<p>The syntax of the f-string is very simple.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">var1 = \"Geeks\"\nvar2 = \"GeekPython\"\n\nf\"Hey, there {var1}, Welcome to {var2}.\"\n\n----\nHey, there Geeks, Welcome to GeekPython.<\/pre><\/div>\n\n\n\n<p>The above example shows the usage of&nbsp;<strong>f-string<\/strong>&nbsp;where the string literal has the letter&nbsp;<code>f<\/code>&nbsp;at the beginning with the placeholders containing expressions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-expressions\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-expressions\"><\/a>Using expressions<\/h2>\n\n\n\n<p>The values are evaluated at the runtime in f-string, so we can put valid arbitrary expressions inside them.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">import math\nexp = f'{math.pow(2, 3)}'\nprint(exp)\n\n&gt;&gt;&gt; 8.0<\/pre><\/div>\n\n\n\n<p>The above code was executed without any error and printed the value of 2 raised to power 3.<\/p>\n\n\n\n<p>Like this, we can use the&nbsp;<strong>user-defined functions<\/strong>&nbsp;inside the f-string. Here&#8217;s the example<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">def add(exp):\n    return exp + 'python'\n\nval = 'geek'\nstr = f'{add(val)}'\nprint(str)\n\n&gt;&gt;&gt; geekpython<\/pre><\/div>\n\n\n\n<p>The function named&nbsp;<code>add()<\/code>&nbsp;was called inside the f-string that adds the&nbsp;<code>exp<\/code>&nbsp;argument with&nbsp;<code>'python'<\/code>&nbsp;and prints it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-methods\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-methods\"><\/a>Using methods<\/h2>\n\n\n\n<p>We can call Python methods directly inside the f-string. The following example will show you calling the methods directly inside the f-string.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">val = 'geekpython'\nstr = f'{val.upper()}'\nprint(str)\n\n&gt;&gt;&gt; GEEKPYTHON<\/pre><\/div>\n\n\n\n<p>In the above code, the&nbsp;<code>upper()<\/code>&nbsp;method was called directly inside the f-string.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-f-string-inside-python-classes\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-f-string-inside-python-classes\"><\/a>Using f-string inside Python classes<\/h2>\n\n\n\n<p>Classes in Python are used in&nbsp;<strong>OOPs<\/strong>&nbsp;(Object Oriented Programming) and we can use objects created from classes with f-string. Here&#8217;s an example below demonstrating the use of f-string inside a Python class.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">class Detail:\n    def __init__(self, firstname, lastname):\n        self.firstname = firstname\n        self.lastname = lastname\n\n    def __str__(self):\n        return f'Hello from {self.firstname} {self.lastname}'<\/pre><\/div>\n\n\n\n<p>Now we can call the class&nbsp;<code>Detail<\/code>&nbsp;with the arguments. Here&#8217;s how we can do it.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">detail = Detail('Geek', 'Python')\nprint(f'{detail}')\n\n&gt;&gt;&gt; Hello from Geek Python<\/pre><\/div>\n\n\n\n<p>In the class&nbsp;<code>Detail<\/code>, the&nbsp;<code>__str__<\/code>&nbsp;method is used for the presentation of the objects as a string and&nbsp;<code>__str__<\/code>&nbsp;is the informal presentation of the string. We could even use&nbsp;<code>__repr__<\/code>&nbsp;to print the objects as the official representation of the string.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">    def __repr__(self):\n        return f'Good bye from {self.firstname} {self.lastname}'\n\nprint(f'{detail!r}')\n\n&gt;&gt;&gt; Good bye from Geek Python<\/pre><\/div>\n\n\n\n<p>Well, you could have noticed that&nbsp;<code>!r<\/code>&nbsp;is used inside the f-string to print the&nbsp;<code>__repr__<\/code>&nbsp;object. It is because&nbsp;<code>!r<\/code>&nbsp;chooses the&nbsp;<code>repr<\/code>&nbsp;method to format the object.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-multiline-f-string\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-multiline-f-string\"><\/a>Using multiline f-string<\/h2>\n\n\n\n<p>We can use multiple f-string in a single statement. Take a look at the example below.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">real_name = 'Robert Downey Jr'\nreel_name = 'Tony Stark'\nhero_name = 'Iron Man'\n\ndetails = (\n    f'The real name is {real_name}, '\n    f'The reel name is {reel_name}, '\n    f'The hero name is {hero_name}.'\n)\nprint(details)\n\n&gt;&gt;&gt; The real name is Robert Downey Jr, The reel name is Tony Stark, The hero name is Iron Man.<\/pre><\/div>\n\n\n\n<p>But there is a flaw in using multiline f-string, we have to place&nbsp;<code>f<\/code>&nbsp;at the beginning of each string when writing multiline f-strings. If we try to do so then we&#8217;ll get something like the below.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">real_name = 'Robert Downey Jr'\nreel_name = 'Tony Stark'\nhero_name = 'Iron Man'\n\ndetails = (\n    f'The real name is {real_name}, '\n    'The reel name is {reel_name}, '\n    'The hero name is {hero_name}.'\n)\nprint(details)\n\n&gt;&gt;&gt; The real name is Robert Downey Jr, The reel name is {reel_name}, The hero name is {hero_name}.<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-escape-sequences\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-escape-sequences\"><\/a>Escape sequences<\/h2>\n\n\n\n<p>We cannot use backlashes inside the f-string to escape the quotation mark and all, if we try to do it, we&#8217;ll get an error.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">val = f'{\\'hello\\'}'\nprint(val)\n\n&gt;&gt;&gt; SyntaxError: f-string expression part cannot include a backslash<\/pre><\/div>\n\n\n\n<p>There is a way to escape quotation marks by using different types of quotes inside the expression.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">val = f\"{'hello'}\"\nprint(val)\n\n&gt;&gt;&gt; hello<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-braces\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-braces\"><\/a>Braces<\/h2>\n\n\n\n<p>If we want to include braces in our code then we should use extra braces to the string literal in order to appear in the output.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">val = f'{{{4**2}}}'\nprint(val)\n\n&gt;&gt;&gt; {16}\n\nval1 = f'{{2 ** 2 * 4}}'\nprint(val1)\n\n&gt;&gt;&gt; {2**2*4}<\/pre><\/div>\n\n\n\n<p>In the first block of code, we used two pairs of braces and we got the output with the braces whereas, in the second block of code, we used a single pair of braces and we didn&#8217;t get the expected output instead we got the whole expression as it is in the f-string.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-format-specifiers\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-format-specifiers\"><\/a>Using format specifiers<\/h2>\n\n\n\n<p>We can use format specifiers to evaluate the expression inside the f-string. The following example demonstrates the usage of&nbsp;<strong>floating-point precision<\/strong>&nbsp;inside the f-string.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">import math\n\nvalue = math.pi\nwidth = 5\nprecision = 10\n\nval = f'result: {value:{width}.{precision}}'\nprint(val)\n\n&gt;&gt;&gt; result: 3.141592654<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-dictionaries\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-dictionaries\"><\/a>Dictionaries<\/h2>\n\n\n\n<p>We have seen the direction to use quotation marks inside an f-string, but we need to be more careful when using the dictionary inside an f-string.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">greet = {'expression': 'Hello', 'from': 'GeekPython'}\n\nmy_dict = f'{greet[\"from\"]} is saying {greet[\"expression\"]}.'\nprint(my_dict)\n\n&gt;&gt;&gt; GeekPython is saying Hello.<\/pre><\/div>\n\n\n\n<p>The above code works because we used different types of quotation marks but if we use the same type of quotation marks then we&#8217;ll get an error.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">greet = {'expression': 'Hello', 'from': 'GeekPython'}\n\nmy_dict = f'{greet['from']} is saying {greet['expression']}.'\nprint(my_dict)\n\n&gt;&gt;&gt; SyntaxError: f-string: unmatched '['<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"heading-using-inline-comments\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-using-inline-comments\"><\/a>Using inline comments<\/h2>\n\n\n\n<p>Expressions inside the f-strings cannot contain comments using the&nbsp;<code>#<\/code>&nbsp;symbol, we&#8217;ll get an error.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">name = 'geeks'\nprint(f'Hey there, {name #this is a comment}')\n\n&gt;&gt;&gt; SyntaxError: f-string expression part cannot include '#'<\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-comparing-the-speed\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-comparing-the-speed\"><\/a>Comparing the speed<\/h1>\n\n\n\n<p>As mentioned earlier, the f-strings are much faster than the other formatting methods. We can say that the letter&nbsp;<code>f<\/code>&nbsp;in f-string stands for &#8220;<strong>fast<\/strong>&#8220;.<\/p>\n\n\n\n<p>Here&#8217;s a speed comparison among&nbsp;<code>f-string<\/code>,&nbsp;<code>%<\/code>&nbsp;formatting and&nbsp;<code>.format<\/code>&nbsp;method.<\/p>\n\n\n\n<p><code>%<\/code>(modulo) operator formatting<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">import timeit\n\nduration_mod = timeit.timeit(\"\"\"name = 'RDJ'\nhero = 'Iron Man'\n'%s plays the role of %s.' % (name, hero)\"\"\", number=10000)\nprint(duration_mod)\n\n&gt;&gt;&gt; 0.00748830009251833<\/pre><\/div>\n\n\n\n<p><code>str.format()<\/code>&nbsp;method<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">import timeit\n\nduration_format = timeit.timeit(\"\"\"name = 'RDJ'\nhero = 'Iron Man'\n'{} plays the role of {}.' .format(name, hero)\"\"\", number=10000)\nprint(duration_format)\n\n&gt;&gt;&gt; 0.009640300180763006<\/pre><\/div>\n\n\n\n<p><code>f-string<\/code><\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:python decode:true \">import timeit\n\nduration_fstring = timeit.timeit(\"\"\"name = 'RDJ' \nhero = 'Iron Man'\nf'{name} plays the role of {hero}.'\"\"\", number=10000)\nprint(duration_fstring)\n\n&gt;&gt;&gt; 0.0016423999331891537<\/pre><\/div>\n\n\n\n<p>We can clearly see the differences in the time of execution of the code for different formatting methods. Thus, we can conclude that the&nbsp;<code>f-string<\/code>&nbsp;took less time to execute the code than the other formatting methods.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"heading-conclusion\"><a href=\"https:\/\/geekpython.in\/f-string-in-python#heading-conclusion\"><\/a>Conclusion<\/h1>\n\n\n\n<p>In this article, we learned about the f-string and its usage in the code. F-string is an improved and modern way to interpolate the string.<\/p>\n\n\n\n<p>F-string reduces the mess in the code and increases the readability of the code and provides flexibility and control over the formatted string literal.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83c\udfc6<strong>Other articles you might like if you like this article<\/strong><\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/integrate-postgresql-database-in-python\" rel=\"noreferrer noopener\">Integrate PostgreSQL database with Python and perform CRUD operations<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/render-images-from-flask\" rel=\"noreferrer noopener\">Display static and dynamic images on the frontend using Flask<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/data-augmentation-in-deep-learning\" rel=\"noreferrer noopener\">Tackle the shortage of data with data augmentation techniques<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/different-ways-to-reverse-a-python-list\" rel=\"noreferrer noopener\">8 Different ways you can reverse a Python list<\/a>.<\/p>\n\n\n\n<p>\u2705<a target=\"_blank\" href=\"https:\/\/geekpython.in\/web-scraping-in-python-using-beautifulsoup\" rel=\"noreferrer noopener\">Scrape the data from the website using BeautifulSoup in Python<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>That&#8217;s all for now<\/strong><\/p>\n\n\n\n<p><strong>Keep Coding\u270c\u270c<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>String interpolation can be performed using multiple ways in Python. There are several methods provided by Python that can help us interpolate strings. Some of them are known as an old school or traditional way of formatting the string and some are added recently been added and gained so much popularity. One of the modern [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":967,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[2],"tags":[12,31],"class_list":["post-964","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-python","tag-python3","entry","has-media"],"_links":{"self":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/comments?post=964"}],"version-history":[{"count":3,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/964\/revisions"}],"predecessor-version":[{"id":995,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/posts\/964\/revisions\/995"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media\/967"}],"wp:attachment":[{"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/media?parent=964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/categories?post=964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekpython.in\/wp-json\/wp\/v2\/tags?post=964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}