A Program to Find the Square Root

In this example, we are giving a program to find the square of a positive number.


Program to find the square root:

  1. # Calcualte the square root of a number
  2. num = float(input('Enter a number: '))
  3. sqrt = num ** 0.5
  4. print('The square root of %0.2f is %0.2f'%(num ,sqrt))

Output:

Enter a number: 25
The square root of 25.00 is 5.00