[ create a new paste ] login | about

Link: http://codepad.org/G2TnigvI    [ raw code | output | fork ]

Python, pasted on Jan 27:
1
2
3
4
5
6
7
8
9
t4p=raw_input ('Enter a number and I will tell you if it is prime...')
div=2
while (div)<=int (t4p)/2: ##while div <= half of t4p run block
    if int (t4p)%(div)!=0: ## integer math with a remainder=potential prime
        (div)=(div)+1  ##add one to div
    else:
        print ('Not Prime')
        break
print ('Prime')


Output:
1
2
3
4
Enter a number and I will tell you if it is prime...Traceback (most recent call last):
  Line 1, in <module>
    t4p=raw_input ('Enter a number and I will tell you if it is prime...')
EOFError


Create a new paste based on this one


Comments: