Python program to check number is prime or not

0
33
num=int(input("Please enter any number: "))
lim=int(num/2)+1
for i in range(2,lim):
     rem=num%i
     if rem==0:
          print(num,"is not a prime number")
          break
else:
    print(num,"is a prime number")

        Output 1:
                 Please enter any number: 5
                 5 is a prime number
        Output 2:
                 Please enter any number: 57
                 57 is not a prime number

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

Python program to check number is prime or not program to check number is prime or not in python program to check number is prime or not write a python program to check number is prime or not python program to check given number is prime or not python program to check whether number is prime or not python program to check if number is prime or not python program to check whether given number is prime or not python program to check whether a number is prime or not using for loop python program to check if the input number is prime or  program to check a number is prime or not python program to check whether a number is prime or not write a python program to check given number is prime or not write a python program to check if a number is prime or not program to check whether a number is prime or not in python program to check a number is prime or not in python python program to check the given number is prime or not python program to check if a number is prime number or not python program to check no is prime or not python program to check whether the number is prime or not write a python program to check the number is prime or not write a python program to check whether the number is prime or not

LEAVE A REPLY

Please enter your comment!
Please enter your name here