daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # coding: utf-8
  2. def is_prime():
  3.     x = int(raw_input("\nEnter Number: "))
  4.     if x < 2:
  5.         return False
  6.     elif x == 2 or x == 3:
  7.         print "\n%s is a prime number.\n" % (x)
  8.         #return True
  9.     for i in range(2, x/2):
  10.         if x % i == 0:
  11.             print "\n%s is not a prime number.\n" % (x)
  12.             is_prime()
  13.             #return False
  14.     print "\n%s is a prime number.\n" % (x)
  15.     is_prime()
  16.     #return True
  17.  
  18. is_prime()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top