# How to Find the Square Root in Python

In this tutorial, we will try to program a "How to Find the Square Root in Python". We will delve deep into how to find the square root of a given number. The main goal here is to understand the structure of the program using a basic formula. I will provide a sample program to demonstrate the actual coding of this tutorial.

This topic is very easy to understand; just follow the instructions I provide, and you can also do it yourself with ease. The program I will show you covers the basics of finding the square root of a number. I will do my best to provide you with the easiest method of creating this program, called "Find the Square Root". So, let's start with the coding.

## Creating Main Function

This is the main function of the application. The following code will display a simple GUI in terminal console that will display the result of finding a square root number. To do this, simply copy and paste these blocks of code into the IDLE text editor.
`while True:    ret=False     print("\n\n================= Find the Square Root  =================\n\n")      num = int(input("Enter a numbe: "))      num_sqrt = num ** 0.5    print('The square root of %0.3f is %0.3f'%(num ,num_sqrt))     user_input=input("\n\nTry again? (Yes/No): ")    print("\n\n")    if user_input.lower()=='no':        print("Exit program.")        break     elif user_input.lower()=='yes':        ret=True     else:        print("Wrong input.")        ret=True      if ret:        continue`

In the provided code, the first step is to use a while loop to enclose all the code to enable the restarting of the program. Next, we set variables to get the user inputs and create an equation that will multiply the number we inputted. Lastly, we create a formula that adds the actual square root value to the number we have provided.