Funny code

Christian Gollwitzer auriocus at gmx.de
Thu Sep 26 04:28:58 EDT 2019


Am 26.09.19 um 08:34 schrieb ast:
> Hello
> 
> A line of code which produce itself when executed
> 
>  >>> s='s=%r;print(s%%s)';print(s%s)
> s='s=%r;print(s%%s)';print(s%s)
> 
> Thats funny !

This is called a "quine" and there exist several methods how to do this.

https://en.wikipedia.org/wiki/Quine_(computing)

	Christian



More information about the Python-list mailing list