k3kaimu
9/13/2014 - 11:47 AM

Pythonの練習

Pythonの練習

#coding: UTF-8

import math

def isPrime(num):
    for i in range(2, int(math.sqrt(num)) + 1):
        if(num % i == 0):
            return False;
    return True;

for i in range(2, 20):
    print(i, " : ", isPrime(i))