Style

Calculating Square Root of any number

 Practice Question #2


Method 1:- 

num = int(input("\n" * 14 + "Write Your Number:- "))

#By exponetial opereter
sqr = num ** (1/2)
print("Your exact value is:- ", sqr, "\n")
print("Your Round off value is:- ", round(sqr))
print("\n" * 3)

Output
Write Your Number:- 4
Your exact value is:-  2.0 
Your Round off value is:-  2


Method 2:-

import math
num = int(input("\n" * 14 + "Write Your Number:- "))

#By Square module
print(math.sqrt(num))

Output
Write Your Number:- 36
The answer is 6.0

Comments

Script