Python Maths Inbuilt Function

pow(a, b)

This function is used to compute value of a raised to the power b (a**b).

import math
print("pow function")
print(math.pow(2,3))
print(math.pow(3,2))
#Output
pow function
8.0
9.0

sqrt()

This function returns the square root of the number.

import math
print("sqrt function")

a=25
print(math.sqrt(a))
a=36
print(math.sqrt(a))
#Output:
sqrt function
5.0
6.0

pi

This is an inbuilt constant that outputs the value of pi(3.141592).

import math

print("pi value")
print(math.pi)
#Output:

pi value
3.141592653589793

Python String inbuilt Methods       Python Math inbuilt Methods       Python Date And Time inbuilt Methods      Python Random inbuilt Methods