{"id":681,"date":"2022-10-17T13:54:25","date_gmt":"2022-10-17T13:54:25","guid":{"rendered":"https:\/\/doublelayer.eu\/vilab\/?p=681"},"modified":"2022-10-17T13:54:25","modified_gmt":"2022-10-17T13:54:25","slug":"string-formatting-in-python","status":"publish","type":"post","link":"https:\/\/doublelayer.eu\/vilab\/2022\/10\/17\/string-formatting-in-python\/","title":{"rendered":"String formatting in Python"},"content":{"rendered":"\n<p>Python has many ways of formatting strings. See <a href=\"https:\/\/realpython.com\/python-f-strings\/\">https:\/\/realpython.com\/python-f-strings\/<\/a>.<br>Recently, I have started using the way which is most familiar to the bash syntax \u2013 It is both compact and readable:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>variable = 'h'\nvalue    = 0.18\nprint(f'Varibable {variable} has a value of {value}')<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python has many ways of formatting strings. See https:\/\/realpython.com\/python-f-strings\/.Recently, I have started using the way which is most familiar to the bash syntax \u2013 It is both compact and readable:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-681","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/comments?post=681"}],"version-history":[{"count":1,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/681\/revisions"}],"predecessor-version":[{"id":682,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/681\/revisions\/682"}],"wp:attachment":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/media?parent=681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/categories?post=681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/tags?post=681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}