{"id":136,"date":"2022-11-04T12:00:00","date_gmt":"2022-11-04T08:30:00","guid":{"rendered":"https:\/\/zahramansoori.com\/blog\/?p=136"},"modified":"2022-11-02T21:56:18","modified_gmt":"2022-11-02T18:26:18","slug":"python-tips-tricks","status":"publish","type":"post","link":"https:\/\/zahramansoori.com\/blog\/2022\/11\/04\/python-tips-tricks\/","title":{"rendered":"Python Tips &#038; Tricks"},"content":{"rendered":"\n<p>How to reverse an array: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">a =\"ApplePie\"\nprint(\"Reverse is\", a[::-1])<\/pre>\n\n\n\n<p>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Reverse is eiPelppA<\/pre>\n\n\n\n<p>How to swap two values:<\/p>\n\n\n\n<p><\/p>\n\n\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-preformatted\">x, y = 10, 20\nprint(x, y)\nx, y = y, x\nprint(x, y)<\/pre>\n<\/div><\/div>\n\n\n\n<p>Output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 20\n20 10<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to reverse an array: a =&#8221;ApplePie&#8221; print(&#8220;Reverse is&#8221;, a[::-1]) Output: Reverse is eiPelppA How to swap two values: x, y = 10, 20 print(x, y) x, y = y, x print(x, y) Output: 10 20 20 10<\/p>\n","protected":false},"author":1,"featured_media":137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[7,40],"class_list":["post-136","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","tag-pythonprogramming","tag-pythontipstricks"],"_links":{"self":[{"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/posts\/136"}],"collection":[{"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":6,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":147,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/posts\/136\/revisions\/147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/media\/137"}],"wp:attachment":[{"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zahramansoori.com\/blog\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}