Solutions for Primality Test

    • @MatthewIdete
    • @alexander, submitted in Python 3, achived 100% score
    from math import sqrt 
    import json
    
    def solve(p):
        F="NotPrime"
        T="Prime"
        if p < 2:
            return F
        elif p <= 3:
            return T
        elif p % 2 == 0 or p % 3 == 0:
            return F
        else:
            for i in range(3, int(sqrt(p)+1), 2):
                if p % i == 0:
                    return F
        return T