{"id":21171,"date":"2021-10-16T11:59:07","date_gmt":"2021-10-16T06:29:07","guid":{"rendered":"https:\/\/tutorial.eyehunts.com\/?p=21171"},"modified":"2022-11-15T18:13:55","modified_gmt":"2022-11-15T12:43:55","slug":"python-print-object-as-a-string-example-code","status":"publish","type":"post","link":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/","title":{"rendered":"Python print object as a string | Example code"},"content":{"rendered":"\n<p>Use str() and __repr()__ methods to print objects as a string in Python. The <a href=\"https:\/\/docs.python.org\/reference\/datamodel.html#object.__str__\"><code>__str__<\/code><\/a> method is what gets called happens when you print it, and the <code>__repr__<\/code> method is what happens when you use the <code>repr()<\/code> function (or when you look at it with the interactive prompt).<\/p>\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>Python print an object as a string example<\/strong><\/h2>\n\n\n\n<p>Simple example code.<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Using str() method<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># object of int\na = 99\n\n# object of float\nb = 100.0\n\n# Converting to string\ns1 = str(a)\nprint(s1)\nprint(type(s1))\n\ns2 = str(b)\nprint(s2)\nprint(type(s2))\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"260\" height=\"207\" src=\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg?resize=260%2C207&#038;ssl=1\" alt=\"Python print object as a string\" class=\"wp-image-21195\"\/><\/figure><\/div>\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Use repr() to convert an object to a string<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>print(repr({\"a\": 1, \"b\": 2}))\nprint(repr(&#91;1, 2, 3]))\n\n\n# Custom class\nclass Test:\n    def __repr__(self):\n        return \"This is class Test\"\n\n\n# Converting custom object to\n# string\nprint(repr(Test()))\n<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: <\/p>\n\n\n\n<p>{&#8216;a&#8217;: 1, &#8216;b&#8217;: 2}<br>[1, 2, 3]<br>This is class Test<\/p>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If no <code>__str__<\/code> method is given, Python will print the result of <code>__repr__<\/code> instead. If you define <code>__str__<\/code> but not <code>__repr__<\/code>, Python will use what you see above as the <code>__repr__<\/code>, but still use <code>__str__<\/code> for printing.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Test:\n    def __repr__(self):\n        return \"Test()\"\n\n    def __str__(self):\n        return \"Member of Test\"\n\n\nt = Test()\nprint(t)<\/code><\/pre>\n\n\n\n<p><strong>Output<\/strong>: Member of Test<\/p>\n\n\n\n<p><strong>Source<\/strong>: stackoverflow.com<\/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 or suggestions on this object tutorial.<\/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>Use str() and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print it, and the __repr__ method is what happens when you use the repr() function (or when you look at it with the interactive prompt). Python print an object as a string&hellip;&nbsp;<a href=\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Python print object as a string | Example code<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[30],"tags":[206,163,98],"post_series":[],"class_list":["post-21171","post","type-post","status-publish","format-standard","hentry","category-python","tag-python-object","tag-python-print","tag-python-string"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.1.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python print object as a string | Example code<\/title>\n<meta name=\"description\" content=\"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python print object as a string | Example code\" \/>\n<meta property=\"og:description\" content=\"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-16T06:29:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-15T12:43:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg\" \/>\n<meta name=\"author\" content=\"Rohit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\",\"name\":\"Python print object as a string | Example code\",\"isPartOf\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg\",\"datePublished\":\"2021-10-16T06:29:07+00:00\",\"dateModified\":\"2022-11-15T12:43:55+00:00\",\"author\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\"},\"description\":\"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg?fit=260%2C207&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg?fit=260%2C207&ssl=1\",\"width\":260,\"height\":207},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorial.eyehunts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python print object as a string | Example code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#website\",\"url\":\"https:\/\/tutorial.eyehunts.com\/\",\"name\":\"Tutorial\",\"description\":\"By EyeHunts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1\",\"name\":\"Rohit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971\",\"contentUrl\":\"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971\",\"caption\":\"Rohit\"},\"description\":\"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.\",\"url\":\"https:\/\/tutorial.eyehunts.com\/author\/rohit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python print object as a string | Example code","description":"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/","og_locale":"en_US","og_type":"article","og_title":"Python print object as a string | Example code","og_description":"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...","og_url":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/","og_site_name":"Tutorial","article_published_time":"2021-10-16T06:29:07+00:00","article_modified_time":"2022-11-15T12:43:55+00:00","og_image":[{"url":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg","type":"","width":"","height":""}],"author":"Rohit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/","url":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/","name":"Python print object as a string | Example code","isPartOf":{"@id":"https:\/\/tutorial.eyehunts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage"},"image":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage"},"thumbnailUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg","datePublished":"2021-10-16T06:29:07+00:00","dateModified":"2022-11-15T12:43:55+00:00","author":{"@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1"},"description":"Use __str()__ and __repr()__ methods to print objects as a string in Python. The __str__ method is what gets called happens when you print...","breadcrumb":{"@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#primaryimage","url":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg?fit=260%2C207&ssl=1","contentUrl":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-as-a-string.jpg?fit=260%2C207&ssl=1","width":260,"height":207},{"@type":"BreadcrumbList","@id":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-as-a-string-example-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorial.eyehunts.com\/"},{"@type":"ListItem","position":2,"name":"Python print object as a string | Example code"}]},{"@type":"WebSite","@id":"https:\/\/tutorial.eyehunts.com\/#website","url":"https:\/\/tutorial.eyehunts.com\/","name":"Tutorial","description":"By EyeHunts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorial.eyehunts.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/69ca2cb8c13fdce0ee5b39d6175119b1","name":"Rohit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorial.eyehunts.com\/#\/schema\/person\/image\/","url":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971","contentUrl":"https:\/\/tutorial.eyehunts.com\/wp-content\/litespeed\/avatar\/2b27529b86d6dfb5336897e07c93a827.jpg?ver=1777374971","caption":"Rohit"},"description":"Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology &amp; like learning technical.","url":"https:\/\/tutorial.eyehunts.com\/author\/rohit\/"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":17063,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-check-if-the-object-is-string-example-code\/","url_meta":{"origin":21171,"position":0},"title":"Python check if the object is string | example code","author":"Rohit","date":"July 28, 2021","format":false,"excerpt":"The best way to checks if the object is a string is by using the isinstance() method in Python. This function returns True if the given object is an instance of class classified or any subclass of class info, otherwise returns False. isinstance(object, class) How to find out if a\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python check if the object is string","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/07\/Python-check-if-the-object-is-string.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":19876,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-print-object-of-class-example-code\/","url_meta":{"origin":21171,"position":1},"title":"Python print object of Class | Example code","author":"Rohit","date":"October 15, 2021","format":false,"excerpt":"Use anyone from the repr() Method or Using the str() Method or Adding New Class Method to print objects in Python. A class is like a blueprint while an object is a copy of the class with actual values. Python print object example Simple example code. Using the repr() Method\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python print object of Class","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-object-of-Class.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":21169,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-print-methods-of-object-example-code\/","url_meta":{"origin":21171,"position":2},"title":"Python print methods of object | Example code","author":"Rohit","date":"October 16, 2021","format":false,"excerpt":"The simplest method is to use dir(object_name) to get all the methods available for that object and use the print method to print it. Python print methods of object example A simple example code uses the built-in dir() function to get a list of all the attributes a module has.\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-methods-of-object.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-methods-of-object.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-methods-of-object.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-methods-of-object.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/10\/Python-print-methods-of-object.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":22318,"url":"https:\/\/tutorial.eyehunts.com\/python\/python-str-function\/","url_meta":{"origin":21171,"position":3},"title":"Python str() function","author":"Rohit","date":"September 30, 2022","format":false,"excerpt":"Python str() function is used to convert the specified value into a string. This method returns the string representation of a given object. str(object, encoding=encoding, errors=errors) object - whose string representation is to be returned encoding - that the given byte object needs to be decoded to (can be UTF-8,\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Python str() function","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2022\/09\/Python-str-function.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":22327,"url":"https:\/\/tutorial.eyehunts.com\/python\/convert-int-to-string-python-example-code\/","url_meta":{"origin":21171,"position":4},"title":"Convert int to string Python | Example code","author":"Rohit","date":"November 16, 2021","format":false,"excerpt":"Use the built-in str() function to convert int to string in Python. The str() function takes in any data type and converts it into a string object. str(integer_value) Example how to convert int to string Python A simple example code converts int to str in Python. Just pass the int\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/tutorial.eyehunts.com\/category\/python\/"},"img":{"alt_text":"Convert int to string Python","src":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2021\/11\/Convert-int-to-string-Python.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":7239,"url":"https:\/\/tutorial.eyehunts.com\/python\/convert-string-to-bytes-python-bytes-encode-method\/","url_meta":{"origin":21171,"position":5},"title":"Convert string to bytes Python | bytes &#038; encode method","author":"Rohit","date":"January 8, 2020","format":false,"excerpt":"To convert string to bytes in Python, you have to use a bytes() method or encode()\u00a0function. A bytes() method returns a bytes object which is immutable (value can't be modified). If you want a mutable value then use\u00a0bytearray()\u00a0method. String to bytes is more popular these days due to the fact\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\/01\/convert-a-string-to-bytes-encode.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/01\/convert-a-string-to-bytes-encode.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/01\/convert-a-string-to-bytes-encode.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/tutorial.eyehunts.com\/wp-content\/uploads\/2020\/01\/convert-a-string-to-bytes-encode.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/21171","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=21171"}],"version-history":[{"count":1,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/21171\/revisions"}],"predecessor-version":[{"id":34142,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/posts\/21171\/revisions\/34142"}],"wp:attachment":[{"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/media?parent=21171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/categories?post=21171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/tags?post=21171"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/tutorial.eyehunts.com\/wp-json\/wp\/v2\/post_series?post=21171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}