Saturday, March 2, 2019

Prime Number - Python3

n=int(input('Enter Number: '))

if n > 1:
    for i in range(2,n):
        if(n%i == 0) :
            print('Not prime')
            break
    else :
        print('Prime')
else:
    print ('Not Prime')

ScreenShot:

No comments:

Post a Comment