Python Program to find square root of a number

In this program, we wll learn how to find the square root of a number using exponent operator and math module.

Find square root using ** Exponentiation operators

1n = 5 2print(f"square root of {n} is {5**2}") 3 4# Output 5square root of 5 is 25

Find square root using math

1import math 2N = 5 3print(f"square root of {N} is {math.pow(N, 2)}") 4 5# Output 6square root of 5 is 25

Using lambda to find square value

1sqrt = lambda i: i**2 2print(f"square root of 2 is {sqrt(2)}") 3 4# Output 5square root of 2 is 4 6