Skip to content

In this program written in python , we read a positive number from the input and determine whether it is a prime number or not.

Notifications You must be signed in to change notification settings

MohammadAbbasi76/PrimeNumberInPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Prime Number In Python

In this program that written in python , we read a positive number from the input and determine whether it is a prime number or not.

Definition of a prime number:A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In other words, a prime number is a number that cannot be evenly divided by any other number except 1 and itself.

Here are a few examples of prime numbers:

2 is the smallest prime number.

3 is a prime number because it cannot be divided evenly by any number other than 1 and 3.

5 is a prime number for the same reason.

7, 11, 13, 17, 19, 23, and so on, are all prime numbers.

However, numbers like 4, 6, 8, 9, 10, and 12 are not prime because they can be divided evenly by numbers other than 1 and themselves.

Prime numbers have various applications in mathematics and computer science, such as cryptography, number theory, and algorithms. They are of great significance and have been studied extensively throughout history.

If the number is prime, we print the word "prime" as the output. If the number is not prime, we print the phrase "not prime" as the output. Input : 25 output: not prime

image

About

In this program written in python , we read a positive number from the input and determine whether it is a prime number or not.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages