In this program, we are going to check whether the given number is prime or not by using python.

**Prime numbers** are those number which are greater than 1 and whose factors are 1 and number itself.

**Example**-2,3,5,7 etc.

**Algorithm:**

- Input a number from the user.
- Using for loop, we use the range from 2 to n/2
- If we find a factor in the above range then the number is not prime
- Else it is prime

**Code:**

```
n= int(input( "enter the number that has to be checked:"))
a=0
for i in range(2,int((n/2))):
if(n%i ==0): //finding whether the number has a factor or not
a=a+1
if(a>1):
print("it is not prime")
else:
print("it is prime ")
```

**Output:**

```
enter the number that has to be checked:97
it is prime
enter the number that has to be checked: 54
it is not prime
```

Report Error/ Suggestion