Python program to check whether a number is Prime or not

Prime numbers:

A prime number is a natural number greater than 1 and having no positive divisor other than 1 and itself.

For example: 3, 7, 11 etc are prime numbers.

Composite number:

Other natural numbers that are not prime numbers are called composite numbers.

For example: 4, 6, 9 etc. are composite numbers.

See this example:

  1. num = int(input(“Enter a number: “))  
  2.   
  3. if num > 1:  
  4.    for i in range(2,num):  
  5.        if (num % i) == 0:  
  6.            print(num,”is not a prime number”)  
  7.            print(i,”times”,num//i,”is”,num)  
  8.            break  
  9.    else:  
  10.        print(num,”is a prime number”)  
  11.          
  12. else:  
  13.    print(num,”is not a prime number”)  

Output:

Python Condition And Loops5

Thought of the day-

“Be yourself, for everybody else is already taken.”- Oscar Wilde

Read This-

क्रत्रिम पेड़ काम कैसे करता है –(How do Synthetic trees work )

पानी के अणु ( Molecule ) एक दुसरे की तरफ आकर्षित होते है | और फिर काफी सारे अणु मिलकर एक बड़ी गोल बूँद का निर्माण कर लेते है ,| कई बार पानी के अणु पानी के अलावा किसी दुसरे पदार्थ के अणु की और ज्यादा आकर्षित हो जाते है , और इसी वजह से वो बिना किसी बल ( force ) के पाइप में कुछ ऊंचाई तक चढ़ जाता है  | अगर पाइप बहुत ज्यादा पतला हो तो पानी कुछ सेमी या इंच तक भी चढ़ सकता है | वर्जिनिया टेक के jonathan Boreyko ने इस सिद्धांत के आधार पर एक नयी खोज की है |

independently created by a human author and possesses at least some minimal degree of creativity.

the fair use of a copyrighted work for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright. 

Fair use is a doctrine in the copyright law that allows limited use of copyrighted material without requiring permission from the rights holders, such as for commentary, criticism, news reporting, research, teaching or scholarship.  It provides for the legal, non-licensed citation or incorporation of copyrighted material in another author’s work under a four-factor balancing test.  The term “fair use” originated in the United States.  A similar principle, fair dealing, exists in some other common law jurisdictions.  Civil law jurisdictions have other limitations and exceptions to copyright. 

Leave a Reply

Your email address will not be published. Required fields are marked *