To find square root of any number in python, you have to ask from user to enter a number to find and print square root of that number as output as shown in the program given below.
Following python program ask from user to enter a number to find the square root of that number and then finally will print the square root as output:
# Python Program - Find Square Root of a Number while True: print("Enter 'x' for exit.") num = input("Enter a number: ") if num == 'x': break else: number = float(num) number_sqrt = number ** 0.5 print("Square Root of %0.2f is %0.2f" %(number, number_sqrt))
Here is the sample run of the above python program to illustrate how to find square root of a number: