prime number program in python

Today, We want to share with you prime number in python.In this post we will show you first n prime numbers python, hear for prime number program in python print 1 to 100 we will give you demo and example for implement.In this post, we will learn about count in python with an example.

Python Program to Check Prime Number

check_no = 23

extra_var = True

if check_no > 1:
    for i in range (2, check_no):
        if(check_no % i) == 0:
            extra_var = False
            break
  

# here check Then Given by user Number is Prime or Not
print(extra_var)
  
if extra_var:
    print(check_no, "Good Luck It number is a absolute prime number")
else:
     print(check_no, "It number is not a PrimeNumber")  

Results:

True
23 Good Luck It number is a absolute prime number

I hope you get an idea about python find prime numbers in range.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment