Python | sympy.Pow() method
With the help of sympy.Pow() method, we can find a raised to the power of b where a and b are parameters to the method.
Syntax: Pow(a, b)
Parameter:
a – It denotes an integer.
b – It denotes an integer.Returns: Returns an integer which is equal to a raised to the power of b, i. e., a^b.
Example #1:
# import Pow() method from sympy from sympy import Pow a = 3b = 3 # Use Pow() method pow_a_b = Pow(a, b) print("{}^{} = {}".format(a, b, pow_a_b)) |
chevron_right
filter_none
Output:
3^3 = 27
Example #2:
# import Pow() method from sympy from sympy import Pow a = 5b = 4 # Use Pow() method pow_a_b = Pow(a, b) print("{}^{} = {}".format(a, b, pow_a_b)) |
chevron_right
filter_none
Output:
5^4 = 625
Recommended Posts:
- class method vs static method in Python
- Python | set() method
- Python | next() method
- Python | os.dup() method
- Python | os.getlogin() method
- Python | os.truncate() method
- Python | os.getenv() method
- Python | sys.getdefaultencoding() method
- Python | os.symlink() method
- Python | sys.getrecursionlimit() method
- Python | os.mkfifo() method
- Python | os.getrandom() method
- Python | Tensorflow abs() method
- Python | os.link() method
- Python | os.ftruncate() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



