Write a Python Program to Check Prime Number?

Updated: Oct 27, 2020


Python Program to Check Prime Number num = int(input("Enter any number: "))

if num > 1:

for i in range(2, num):

if num % i == 0:

print("The number is not prime",num)

break

else:

print("The number is prime",num)


Output:

Enter any number: 5 The number is prime 5



17 views0 comments

Recent Posts

See All
 

9555593818

Thakurdwara, Uttar Pradesh 244601, India

  • Facebook
  • Twitter
  • LinkedIn