shortest python quine?

后端 未结 10 1793
天涯浪人
天涯浪人 2020-12-23 19:55
_=\'_=%r;print _%%_\';print _%_

Is this the shortest possible python quine, or can it be done better? This one seems to improve on all the entrie

10条回答
  •  爱一瞬间的悲伤
    2020-12-23 20:24

    Here is another similar to postylem's answer.

    Python 3.6:

    print((lambda s:s%s)('print((lambda s:s%%s)(%r))'))
    

    Python 2.7:

    print(lambda s:s%s)('print(lambda s:s%%s)(%r)')
    

提交回复
热议问题