Wednesday, July 3, 2024
HomeLanguagesPythonPython | sympy.Pow() method

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 = 3
b = 3
  
# Use Pow() method 
pow_a_b = Pow(a, b) 
      
print("{}^{} = {}".format(a, b, pow_a_b))


Output:

3^3 = 27

Example #2:




# import Pow() method from sympy
from sympy import Pow
  
a = 5
b = 4
  
# Use Pow() method 
pow_a_b = Pow(a, b) 
      
print("{}^{} = {}".format(a, b, pow_a_b))


Output:

5^4 = 625
Shaida Kate Naidoo
am passionate about learning the latest technologies available to developers in either a Front End or Back End capacity. I enjoy creating applications that are well designed and responsive, in addition to being user friendly. I thrive in fast paced environments. With a diverse educational and work experience background, I excel at collaborating with teams both local and international. A versatile developer with interests in Software Development and Software Engineering. I consider myself to be adaptable and a self motivated learner. I am interested in new programming technologies, and continuous self improvement.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments