{"id":2754,"date":"2020-02-20T11:01:29","date_gmt":"2020-02-20T05:31:29","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=2754"},"modified":"2022-11-15T15:24:34","modified_gmt":"2022-11-15T09:54:34","slug":"python-power","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-power\/","title":{"rendered":"Python Power | pow() | Python Power Operator"},"content":{"rendered":"\n<p>The power (or exponent) of a number says how many times to use the number in a multiplication. Calculating the power of any number is a vital job. Because the power of a number can be needed in many mathematics as well as in big projects.\u00a0It has many-fold applications in day to day programming. Calculating <strong>Python Power<\/strong> is easy and can be done in a few lines.  Python comes with a host of different functions each built specifically to add more versatility to the interface than before.<\/p>\n\n\n\n<p><strong>To calculate the power of a number in Python we have basically three techniques or methods. The first one in the Python ecosystem is the power function, also represented as the pow(). The second way is to use the Power Operator. Represented or used as ** in Python. And the third one is using loops or iteration. In this article, we will discuss the Power function, Calculating the power of a number using loops and Power Operator in Python. <\/strong><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-power\/#What_is_Power_pow_Function_in_Python\" >What is Power pow() Function in Python?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Syntax_of_pow_Function\" >Syntax of pow() Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Parameters\" >Parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Meaning_Usage_of_xyz_in_pow\" >Meaning \/ Usage of x,y,z in pow()<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Return_Value_and_Implementation_Cases_in_pow_Function\" >Return Value and Implementation Cases in pow() Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Examples_to_Calculate_Python_Power_using_pow_Function\" >Examples to Calculate Python Power using pow() Function<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/python-power\/#What_is_Python_Power_Operator\" >What is Python Power Operator<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/python-power\/#How_to_Use_Power_Operator_in_Python\" >How to Use Power Operator in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Syntax\" >Syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Examples_to_Use_the_Power_Operator_in_Python\" >Examples to Use the Power Operator in Python<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Note\" >Note:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Calculating_Python_Power_of_a_Number_Using_Loops\" >Calculating Python Power of a Number Using Loops<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Must_Read\" >Must Read<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Remarks\" >Remarks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/python-power\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"has-vivid-red-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Power_pow_Function_in_Python\"><\/span><strong>What is Power pow() Function in Python?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p> One important basic arithmetic operator, in Python, is the\u00a0<em>exponent operator<\/em>. It takes in two real numbers as input arguments and returns a single number. Pow can be used with 3 arguments to do modulo division. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Syntax_of_pow_Function\"><\/span>Syntax of pow() Function<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>pow(<em>x, y, z<\/em>) <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Parameters\"><\/span>Parameters<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The\u00a0<strong>pow()<\/strong>\u00a0function in Python takes three parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>x<\/strong>\u00a0&#8211; a number, the base<\/li><li><strong>y<\/strong>\u00a0&#8211; a number, the exponent<\/li><li><strong>z (optional)<\/strong>\u00a0&#8211; a number, used for modulus<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Meaning_Usage_of_xyz_in_pow\"><\/span>Meaning \/ Usage of x,y,z in pow()<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The x,y,z parameters in pow() function can be used like the following.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>pow(x, y)<\/code>\u00a0is equal to\u00a0<code>x<sup>y<\/sup><\/code><\/li><li><code>pow(x, y, z)<\/code>\u00a0is equal to\u00a0<code>x<sup>y<\/sup>\u00a0% z<\/code><\/li><\/ul>\n\n\n\n<ol class=\"wp-block-list\"><li>X: X can either be a non-negative integer or a negative integer whenever it is being used.\u00a0<\/li><li>Y: Y can also be a non-negative integer or a negative integer when used in the equation.<\/li><li> Z: In most cases, z is an optional variable and may or may not be present. <\/li><\/ol>\n\n\n\n<p>Note: Here the third parameter in pow() is optional. So you can use the pow() function with only two parameters. <strong>And in place of x,y,z you can use any variable.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Return_Value_and_Implementation_Cases_in_pow_Function\"><\/span><strong>Return Value and Implementation Cases in pow() Function<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"2000\" height=\"1545\" src=\"https:\/\/i2.wp.com\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure.jpg?fit=1024%2C791&amp;ssl=1\" alt=\"pow() function\" class=\"wp-image-2769\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure.jpg 2000w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure-300x232.jpg 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure-1024x791.jpg 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure-768x593.jpg 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Orange-Modern-Travel-Trifold-Brochure-1536x1187.jpg 1536w\" sizes=\"(max-width: 2000px) 100vw, 2000px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Examples_to_Calculate_Python_Power_using_pow_Function\"><\/span>Examples to Calculate Python Power using pow() Function<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In the following examples, we will calculate the Python Power of a number using pow() function.<\/p>\n\n\n\n<p>Let&#8217;s Start.<\/p>\n\n\n\n<p><strong>Example 1: Basic Example to calculate the power of a number using pow() function<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># taking x and y oth as positive\nprint(pow(5, 2))\n\n# taking x as negative and y as positive\nprint(pow(-5, 2))\n\n# taking x as positive and y as negative\nprint(pow(5, -2))\n\n# taking x as negative and y as negative\nprint(pow(-5, -2))<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>25\n25\n0.04\n0.04<\/code><\/pre>\n\n\n\n<p><strong>Example 2: <\/strong> <strong>Using a floating number to calculate power of a number:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pow1 = pow(5,2.5)\n \npow2 = pow(8,2.5)\n \npow3 = pow(9,2.5)\n \nprint(\"The exponent of 5**2.5 = \",pow1)\n \nprint(\"The exponent of 8**2.5 = \",pow2)\n \nprint(\"The exponent of 9**2.5 = \",pow3)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>The exponent of 5**2.5 =  55.90169943749474\nThe exponent of 8**2.5 =  181.01933598375618\nThe exponent of 9**2.5 =  243.0<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"405\" height=\"296\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-19.jpg\" alt=\"Using a floating number to calculate power of a number.\" class=\"wp-image-2787\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-19.jpg 405w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-19-300x219.jpg 300w\" sizes=\"(max-width: 405px) 100vw, 405px\" \/><\/figure><\/div>\n\n\n\n<p><strong>Example 3: Using the third argument (modulo) in pow() function<\/strong> <\/p>\n\n\n\n<p>It&#8217;s also possible to calculate\u00a0 a^<strong>b<\/strong> <em>mod<\/em> m.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>>>> pow(a,b,m)  \n<\/code><\/pre>\n\n\n\n<p>This is very helpful in computations where you have to print the resultant % mod.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Note<\/strong>: Here,\u00a0a\u00a0and\u00a0b\u00a0can be floats or negatives, but, if a third argument is present,\u00a0b\u00a0cannot be negative.<\/p>\n\n\n\n<p><strong>Python program that uses pow with 3 arguments<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x = 12\ny = 2\nz = 5\n \nprint(pow(x, y, z))<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>4<\/code><\/pre>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<p>So in the above example, we have three parameters x,y and z. Here x is the base number. The y variable is the exponential or power of a number and z is the modulus.<\/p>\n\n\n\n<p>The above example can be written in simple mathematics as <\/p>\n\n\n\n<p><strong>12^2%5 which is equal to 4<\/strong><\/p>\n\n\n\n<p><strong>Example 4: Basic Example to calculate the power of a number using math.pow() function<\/strong><\/p>\n\n\n\n<p>Here in this example, we have to import the <strong>math module<\/strong> to calculate the power of a number.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import math\n\nprint(math.pow(5,2))<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<p>25.0<\/p>\n\n\n\n<p><strong>Note<\/strong>: <em><strong>Python has a math module that has its own\u00a0pow(). It takes two arguments and returns a floating-point number. Frankly speaking, we will never use\u00a0math.pow().<\/strong><\/em><\/p>\n\n\n\n<h2 class=\"has-vivid-red-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_Python_Power_Operator\"><\/span><strong>What is<\/strong> Python Power Operator<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong>In Python,<\/strong>\u00a0power operator (**) and pow() function are equivalent. So we can use whichever one seems clearest. I feel pow is clearer, but I rarely need exponents in programs.<\/p>\n\n\n\n<p> <strong>** operator used as a power(exponent) operator in python.<\/strong><\/p>\n\n\n\n<p>Raising a number to a power N multiplies the number by itself N times. For instance,\u00a0<code>2<\/code>\u00a0raised to the power of\u00a0<code>3<\/code>\u00a0is equal to\u00a0<code>2<\/code>\u00a0\u00d7\u00a0<code>2<\/code>\u00a0\u00d7\u00a0<code>2<\/code>\u00a0=\u00a0<code>8<\/code>. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Use_Power_Operator_in_Python\"><\/span>How to Use Power Operator in Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To use the power operator (**) in Python, We have to put (**) between two numbers to raise the former number to the latter.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p><strong>a**b<\/strong><\/p>\n\n\n\n<p>Here <strong>a<\/strong> is Any expression evaluating to a numeric type. And <strong>b<\/strong> any expression evaluating to a numeric type. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Examples_to_Use_the_Power_Operator_in_Python\"><\/span>Examples to Use the Power Operator in Python<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#Python power <a href=\"http:\/\/www.pythonpool.com\/python-__lt__\/\" target=\"_blank\" rel=\"noopener\">operator<\/a> example\n#Change the below value and try it yourself.\n\na = 25\nb = 3\n\nresult = a ** b\n\nprint(result)<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<p>15625<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"353\" height=\"217\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-20.jpg\" alt=\"Examples to Use the Power Operator in Python\" class=\"wp-image-2794\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-20.jpg 353w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-20-300x184.jpg 300w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Note\"><\/span>Note:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The python power operator accepts any numeric data type, such as an int or a floating-point number. <\/p>\n\n\n\n<h2 class=\"has-vivid-red-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"Calculating_Python_Power_of_a_Number_Using_Loops\"><\/span>Calculating Python Power of a Number Using Loops<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this method to calculate the power of a number, we are using the <strong>for loop<\/strong>.<br>This method or way is also known as the <strong>naive method<\/strong> to compute power.<\/p>\n\n\n\n<p>This\u00a0Python program\u00a0allows the user to enter any <a href=\"https:\/\/en.wikipedia.org\/wiki\/Numerical\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"numerical value (opens in a new tab)\">numerical value<\/a>, exponent. Next, this\u00a0Python\u00a0program\u00a0finds the power of a number using\u00a0For Loop.<\/p>\n\n\n\n<p><strong>Program to calculate power of a number using for loop.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Python Program to find Power of a Number using for loop\n\nnumber = int(input(\" Please Enter any number : \"))\nexponent = int(input(\" Enter Exponent Value : \"))\npower = 1\n\nfor i in range(1, exponent + 1):\n    power = power * number\n    \nprint(\"The Result of {0} Power {1} = {2}\".format(number, exponent, power))<\/code><\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Please Enter any number : 20\nEnter Exponent Value : 2\nThe Result of 20 Power 2 = 400<\/code><\/pre>\n\n\n\n<p>This Python power of a number program\u00a0using the <strong>while loop<\/strong> will be the same as above, but this time, we are using \u00a0While Loop instead of <strong>for loop<\/strong>.<\/p>\n\n\n\n<h2 class=\"has-pale-pink-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"Must_Read\"><\/span>Must Read<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"has-text-color has-vivid-cyan-blue-color\"><a href=\"http:\/\/www.pythonpool.com\/python-lowercase\/\">How to Convert String to Lowercase in Python<\/a><br><a href=\"http:\/\/www.pythonpool.com\/square-root-in-python\/\">How to Calculate Square Root in Python<\/a><br><a href=\"http:\/\/www.pythonpool.com\/python-user-input\/\">Python User Input | Python Input () Function | Keyboard Input<\/a><br><a href=\"http:\/\/www.pythonpool.com\/python-book\/\">Best Book to Learn Python in 2020<\/a> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Remarks\"><\/span>Remarks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Python defines pow(0, 0) and 0 ** 0 to be 1, as is common for programming languages.<\/p>\n\n\n\n<h2 class=\"has-vivid-purple-color has-text-color wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So we have covered all the possible ways or methods to calculate the <strong>Python Power<\/strong> of a number. Power function in Python, when used correctly can eliminate a lot of stress and confusion. We hope that from this article you have learned how to use the power function in Python correctly and thus will make use of the same in your day to day programming.<\/p>\n\n\n\n<p>If you still have any doubts or suggestions regarding the python power do let us know in the comment section below.<\/p>\n\n\n\n<p><strong>Happy Coding!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The power (or exponent) of a number says how many times to use the number in a multiplication. Calculating the power of any number is &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Python Power | pow() | Python Power Operator\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-power\/#more-2754\" aria-label=\"More on Python Power | pow() | Python Power Operator\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2771,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4,15],"tags":[635,643,631,641,645,642,657,632,637,656,639,638,634,652,633,630,644,655,654,636,640,646,650,649,647,653,648,651],"class_list":["post-2754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programs","category-tutorials","tag-math-power-python","tag-power-bi-python","tag-power-function-in-python","tag-power-function-python","tag-power-in-python","tag-power-in-python-3","tag-power-of-2-python","tag-power-operator-python","tag-power-python","tag-power-set-python","tag-power-spectral-density-python","tag-python-e-to-the-power","tag-python-math-power","tag-python-numpy-power","tag-python-power","tag-python-power-function","tag-python-power-of","tag-python-power-of-2","tag-python-power-operator","tag-python-power-set","tag-python-power-twister","tag-python-raise-to-power","tag-python-to-the-power","tag-python-to-the-power-of","tag-raise-to-power-python","tag-to-the-power-of-python","tag-to-the-power-python","tag-which-mathematical-operator-is-used-to-raise-five-to-the-second-power-in-python","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Power | pow() | Python Power Operator - Python Pool<\/title>\n<meta name=\"description\" content=\"To calculate the power of a number in Python we have basically three techniques or methods. The first one in the Python ecosystem is the power function.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-power\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Power | pow() | Python Power Operator\" \/>\n<meta property=\"og:description\" content=\"The power (or exponent) of a number says how many times to use the number in a multiplication. Calculating the power of any number is a vital job. Because\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-power\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-20T05:31:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-15T09:54:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Python Pool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Python Pool\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Python Power | pow() | Python Power Operator\",\"datePublished\":\"2020-02-20T05:31:29+00:00\",\"dateModified\":\"2022-11-15T09:54:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/\"},\"wordCount\":974,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg\",\"keywords\":[\"math power python\",\"power bi python\",\"power function in python\",\"power function python\",\"power in python\",\"power in python 3\",\"power of 2 python\",\"power operator python\",\"power python\",\"power set python\",\"power spectral density python\",\"python e to the power\",\"python math power\",\"python numpy power\",\"python power\",\"python power function\",\"python power of\",\"python power of 2\",\"python power operator\",\"python power set\",\"python power twister\",\"python raise to power\",\"python to the power\",\"python to the power of\",\"raise to power python\",\"to the power of python\",\"to the power python\",\"which mathematical operator is used to raise five to the second power in python?\"],\"articleSection\":[\"Programs\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-power\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-power\/\",\"name\":\"Python Power | pow() | Python Power Operator - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg\",\"datePublished\":\"2020-02-20T05:31:29+00:00\",\"dateModified\":\"2022-11-15T09:54:34+00:00\",\"description\":\"To calculate the power of a number in Python we have basically three techniques or methods. The first one in the Python ecosystem is the power function.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-power\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg\",\"width\":1020,\"height\":615,\"caption\":\"Python Power\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-power\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Power | pow() | Python Power Operator\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\",\"name\":\"Python Pool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"caption\":\"Python Pool\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Power | pow() | Python Power Operator - Python Pool","description":"To calculate the power of a number in Python we have basically three techniques or methods. The first one in the Python ecosystem is the power function.","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:\/\/www.pythonpool.com\/python-power\/","og_locale":"en_US","og_type":"article","og_title":"Python Power | pow() | Python Power Operator","og_description":"The power (or exponent) of a number says how many times to use the number in a multiplication. Calculating the power of any number is a vital job. Because","og_url":"https:\/\/www.pythonpool.com\/python-power\/","og_site_name":"Python Pool","article_published_time":"2020-02-20T05:31:29+00:00","article_modified_time":"2022-11-15T09:54:34+00:00","og_image":[{"width":1020,"height":615,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg","type":"image\/jpeg"}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-power\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-power\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Python Power | pow() | Python Power Operator","datePublished":"2020-02-20T05:31:29+00:00","dateModified":"2022-11-15T09:54:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-power\/"},"wordCount":974,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-power\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg","keywords":["math power python","power bi python","power function in python","power function python","power in python","power in python 3","power of 2 python","power operator python","power python","power set python","power spectral density python","python e to the power","python math power","python numpy power","python power","python power function","python power of","python power of 2","python power operator","python power set","python power twister","python raise to power","python to the power","python to the power of","raise to power python","to the power of python","to the power python","which mathematical operator is used to raise five to the second power in python?"],"articleSection":["Programs","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-power\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-power\/","url":"https:\/\/www.pythonpool.com\/python-power\/","name":"Python Power | pow() | Python Power Operator - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-power\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-power\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg","datePublished":"2020-02-20T05:31:29+00:00","dateModified":"2022-11-15T09:54:34+00:00","description":"To calculate the power of a number in Python we have basically three techniques or methods. The first one in the Python ecosystem is the power function.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-power\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-power\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-power\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/02\/Capture-18.jpg","width":1020,"height":615,"caption":"Python Power"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-power\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python Power | pow() | Python Power Operator"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998","name":"Python Pool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","caption":"Python Pool"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=2754"}],"version-history":[{"count":41,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2754\/revisions"}],"predecessor-version":[{"id":24493,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2754\/revisions\/24493"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/2771"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=2754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=2754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=2754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}