Prime Numbers by Logic Leads

def solve(N):\x0d
    ans  = []\x0d
    num = 2\x0d
    while len(ans) < N:\x0d
        pre = [num for i in ans if num%i == 0]\x0d
        if pre:\x0d
            ans+=[]\x0d
        else:\x0d
            print(num)\x0d
            ans+=[num]\x0d
        num += 1\x0d
    \x0d
n=int(input())\x0d
solve(n)\x0d

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page