# How to Find Prime Number in Python

A prime number is a positive integer number that is divisible by exactly 2 integers (1 and the number itself). 1 is not a prime number.

n = 513 if n>1: for i in range(2, n): if (n%i) == 0: print(n, " is not a primenumber") break else: print(n, "is a primenumber") else: print(n, "is not a primenumber")

Output:

513 is not a primenumber

Subscribe

Login

Please login to comment

0 Discussion