{"id":11052,"date":"2022-06-12T22:14:05","date_gmt":"2022-06-12T19:14:05","guid":{"rendered":"https:\/\/elzero.org\/?p=11052"},"modified":"2022-08-07T07:55:17","modified_gmt":"2022-08-07T04:55:17","slug":"python-implement-string-fill-function","status":"publish","type":"post","link":"https:\/\/elzero.org\/old\/python-implement-string-fill-function\/","title":{"rendered":"String Fill Function"},"content":{"rendered":"<h3>\u0645\u062d\u062a\u0648\u0649 \u0627\u0644\u062f\u0631\u0633<\/h3>\r\n\r\n<script type=\"text\/plain\" class=\"language-python\">\r\ndef elzero_string_fill(txt: str, width: int, fill_with) -> str:\r\n  return str(fill_with) * (width - len(txt)) + txt\r\n\r\nprint(elzero_string_fill(\"123\", 10, \"A\"))\r\nprint(elzero_string_fill(\"1234\", 10, \"A\"))\r\nprint(elzero_string_fill(\"12345\", 10, \"A\"))\r\nprint(elzero_string_fill(\"123456\", 10, \"A\"))\r\nprint(elzero_string_fill(\"1234567\", 10, \"A\"))\r\nprint(elzero_string_fill(\"12345678\", 10, \"A\"))\r\nprint(elzero_string_fill(\"123456789\", 10, \"A\"))\r\nprint(elzero_string_fill(\"1234567890\", 10, \"A\"))\r\n<\/script>","protected":false},"excerpt":{"rendered":"<p>\u0645\u062d\u062a\u0648\u0649 \u0627\u0644\u062f\u0631\u0633<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1156],"tags":[],"class_list":["post-11052","post","type-post","status-publish","format-standard","hentry","category-functions-implement"],"_links":{"self":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/comments?post=11052"}],"version-history":[{"count":2,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11052\/revisions"}],"predecessor-version":[{"id":11697,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/posts\/11052\/revisions\/11697"}],"wp:attachment":[{"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/media?parent=11052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/categories?post=11052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elzero.org\/old\/wp-json\/wp\/v2\/tags?post=11052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}