Home » Programming
Square Numbers and Exponents in Python, With Examples
This tutorial will show you how to use exponents (e.g., calculating the square root of a number) in Python, with some code examples. This tutorial covers several ways to calculate exponents in Python 3. Using ** (Power Operator) The ** mathematical operator (known as the power operator) will calculate an exponent, raising the number on the left to the power of the number on the right of the operator: 4**5 # Will evaluate 4*4*4*4*4 and return the integer value 1024 Note that: You will receive a ZeroDivisionError if you try to raise 0 (zero) … Read more