Share your repls and programming experiences

← Back to all posts
New Python Quine!
h
MarcusWeinberger (590)

What is a quine?

According to Wikipedia, the definition of a quine is as follows,

A quine is a computer program which takes no input and produces a copy of its own source code as its only output. ... For amusement, programmers sometimes attempt to develop the shortest possible quine in any given programming language.

The Code

Thanks to python 3.8 and the introduction of the walrus operator, I have made my own python quine:

print((_:='print((_:=%r)%%_)')%_)

The previous best quine for python is _='_=%r;print(_%%_)';print(_%_) which I took inspiration from.

Commentshotnewtop