s=p=1;exec"if s%p*s%~-~p:print`p`+','+`p+2`\ns*=p*p;p+=2\n"*999
最佳答案
这里是对基本思想的阐述。
# p = 1; s = p
s=p=1
#exec"if s%p*s%~-~p:print`p`+','+`p+2`\ns*=p*p;p+=2\n"*999
for i in range(999):
# s%p = remainder of s/p
# ~p = 1s complement of p
if s%p*s%~-~p:
# `p` = repr(p)
print`p`+','+`p+2`
# s = s*p*p
s*=p*p
# p = p+2
p+=2
关于python - 这个 Python 单行代码是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4529452/