{"id":13005,"date":"2021-12-20T13:00:06","date_gmt":"2021-12-20T13:00:06","guid":{"rendered":"https:\/\/linuxways.net\/?p=13005"},"modified":"2021-12-20T13:00:06","modified_gmt":"2021-12-20T13:00:06","slug":"python-pow-function","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/scripting\/python-pow-function\/","title":{"rendered":"Python pow() Function"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>The pow() function in Python returns the power of a number entered. It is built into Python and returns the result of the value of x to the power of y. If a 3rd parameter appears, the pow() will return x power of y, modulus z. This function converts its arguments to float first and then calculates the exponentiation.<\/p>\n<p>Now we&#8217;re gonna guide you about using the pow() function in Python. Hope you understand.<\/p>\n<h2>Example<\/h2>\n<pre>x = pow(2, 4)\r\n\r\nprint(x)<\/pre>\n<p>Output:<\/p>\n<p><strong>16<\/strong><\/p>\n<h2>Definition<\/h2>\n<p>The pow() function will print out the result of the value of x power of y.<\/p>\n<p>If a 3rd parameter appears, the function will return x power of y, modulus z.<\/p>\n<h2>The syntax<\/h2>\n<pre>pow(x, y, z)<\/pre>\n<p><strong>Parameter Values:<\/strong><\/p>\n<p>x: radix (required)<\/p>\n<p>y: exponent (required)<\/p>\n<p>z: modulus (optional)<\/p>\n<h2>More examples<\/h2>\n<p><strong>Example 1<\/strong>: Basic pow() function<\/p>\n<pre>x = pow(3, 3)\r\n\r\nprint(x)<\/pre>\n<p>Output:<\/p>\n<p><strong>27<\/strong><\/p>\n<p><strong>Example 2<\/strong>: pow() with three argument<\/p>\n<pre>x = pow(2, 4, 10)\r\n\r\nprint(x)<\/pre>\n<p>Output:<\/p>\n<p><strong>6<\/strong><\/p>\n<p><strong>Example 3<\/strong>: pow() combines input()<\/p>\n<pre>print(\"Enter the radix: \")\r\n\r\nx = int(input())\r\n\r\nprint(\"Enter the exponent: \")\r\n\r\ny = int(input())\r\n\r\npower = pow(x,y)\r\n\r\nprint(\"Result:\",power)<\/pre>\n<p>Output:<\/p>\n<p><strong>Enter the radix: 2 <\/strong><\/p>\n<p><strong>Enter the exponent: 2 <\/strong><\/p>\n<p><strong>Result: 4<\/strong><\/p>\n<h2>Conclusion<\/h2>\n<p>And we guided you on how to use the pow() function in Python.<\/p>\n<p>Thank you for checking it out!<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction The pow() function in Python returns the power of a number entered. It is built into Python and returns the result of the value of x to&hellip;<\/p>","protected":false},"author":1,"featured_media":13245,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[168],"tags":[10],"class_list":["post-13005","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-python"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=13005"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13005\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13245"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}