Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = int(raw_input("Enter a number:"))
- div = []
- x = range(1, num + 1)
- for i in x:
- if num % i == 0:
- div.append(i)
- if div == [1, num]:
- print "the number is prime."
- else:
- print "the number is not prime and the factors are %r " % div
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement