 # Python Program to Find Square of a Number

Python program to find square of a number; In this tutorial, you will learn how to find or calculate square of a number in python using function, exponent operator.

## Python Program to Find Square of a Number

There are a following python programs to find or calculate square of a number; as shown below:

• Python program to find the square of given number
• Python program to find given number Using math power() function
• Python program find a square of given number using Exponent Operator

Now let’s see each one by one:

### 1: Python program to find the square of given number

• Take input number from the user
• Calculate the square of given number using * operator
• Display square of the given number
```# Python program to calculate square of a number
# Method 1 (using  number*number)

# take input a number from user
num = int(input("Enter an any number: "))

# calculate square using * operator
sq = num*num

# display result
print("Square of {0} is {1} ".format(num, sq))
```

Output

```Enter an any number:  5
Square of 5 is 25  ```

### 2: Python program to find given number Using math pow() function

• Take input number from the user
• Calculate the square of the given number using math pow() function
• Display square of the given number
```# Python program to calculate square of a number using math module

# importing math module
import math

# take input a number from user
num = int(input("Enter an any number: "))

# calculate square using pow() function
square = int(math.pow (num, 2))

# display result
print("Square of {0} is {1} ".format(num, square))
```

Output

```Enter an any number:  7
Square of 7 is 49  ```

### 3: Python program find a square of given number using Exponent Operator

• Take input number from the user
• Calculate the square of given number using Exponent Operator
• Display square of the given number
```# Python program to calculate square of a number using Exponent Operator

# take input from user
num = int (input("Enter an any number: "))

# calculate square using Exponent Operator
sq = num**2

# print
print("Square of {0} is {1} ".format(num, sq))
```

Output

```Enter an any number:  9
Square of 9 is 81  ```

## Recommended Python Programs 