Horje
effient way to find prime no inpython Code Example
effient way to find prime no inpython
Python Code:

n = int(input("Enter a number: "))
isPrime = True
if n > 1:
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            isPrime = False
            break
    if isPrime:
        print("Prime")
    else:
        print("Not prime")
else:
    print("Not prime")
    
    
    
Sample input:

Number: 32261

Sample output:

Prime

effient way to find prime no inpython
num = 13
if num > 1:
for i in range(2, num//2):
if (num % i) == 0:
print(num, "is not a prime number")
break
else:
print(num, "is a prime number")
else:
print(num, "is not a prime number")




Python

Related
filter all columns in pandas Code Example filter all columns in pandas Code Example
find poser hair Code Example find poser hair Code Example
How to colour a specific cell in pandas dataframe Code Example How to colour a specific cell in pandas dataframe Code Example
python print value and variable name Code Example python print value and variable name Code Example
generate a random np image array with shape Code Example generate a random np image array with shape Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8