@mcredq/FocusedAnguishedIchthyostega
Python

No description

repl talk
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from math import *
def pr1(k):
    if k==1:
        return False
    i=2
    while i*i<=k:
        if k%i==0:
            return False
        i=i+1
    return True

def pr2(k):
    if k==1:
        return False
    i=2
    sqrt_k=sqrt(k)
    while i<=sqrt_k:
        if k%i==0:
            return False
        i=i+1
    return True

print pr1(10)
Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.8.2] on linux