Python program to calculate the square root

This is a python program to calculate the square root. tested in python version 3.4




1
2
3
4
# Python program to calculate the square root
num = float(input('Enter a number: '))
num_sqrt = num**0.5
print('The square root of %0.3f is %0.3f'%(num,num_sqrt))

Output:

Enter a number: 4
The square root of 4.000 is 2.000

Comments