Python program to take a number as input and calculate the square root of given number

Views: 104   

Following program shows you how to take a number as input and calculate the square root of given number.
In this program we get number from user and calculate square root using Math.sqrt() method

import math
number = float(input("Please enter a number:"))
result = math.sqrt(number)
print("Squre root of ", number, " is: ", result)

Output:

Please enter a number: 16
Squre root of  16.0  is:  4.0
On By