sdaryan / Prime-number-determination

Read a positive number as input in this program and determine whether it is a prime number or not.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prime-number-determination

python

"Read a positive number as input in this program and determine whether it is a prime number or not. Definition of a prime number: A number that is not divisible by any other number except 1 and itself. For example, 7 is a prime number because it is only divisible by 1 and 7. The number 6 is not prime because it is divisible by 2 and 3 in addition to 1 and 6.

If the number is prime, print "prime" in the output, and if it is not prime, print "not prime" in the output. Please note that the output should be exactly as stated. It is important to have lowercase letters.

Sample Input: 25

Sample Output: not prime"


در این برنامه یک عدد مثبت از ورودی بخوانید و تعیین کنید آیا این عدد اول است یا خیر. تعریف عدد اول‌: به غیر از یک و خودش به هیچ عدد دیگری بخشپذیر نباشد. مثلا ۷ عدد اول است چون فقط به یک و ۷ بخشپذیر است. عدد ۶ اول نیست چون به غیر از ۱ و ۶ به ۲ و به ۳ نیز بخشپذیر است.

درصورتی که عدد اول بود در خروجی عبارت prime را چاپ کنید و در صورتی که عدد اول نبود در خروجی عبارت not prime را چاپ کنید. لطفا دقت کنید که خروجی دقیقا طبق آنچه گفته شده است باشد. کوچک بودن حروف مهم است.

ورودی نمونه:

25

خروجی نمونه:

not prime

About

Read a positive number as input in this program and determine whether it is a prime number or not.


Languages

Language:Python 100.0%