dieses Beispiel quine Gefunden:Wie funktioniert das Python 3 quine?
s='s=%r;print(s%%s)';print(s%s)
ich, dass %s
und %r
die str
und repr
Funktionen tun, als here spitz, aber was genau bedeutet den s%s
Teil und wie die quine funktioniert?
Spezifisch bedeutet '% r' die Funktion' repr() 'im Gegensatz zu' str() '('% s'). Siehe ['printf'-artige String-Formatierung] (https://docs.python.org/3.5/library/stdtypes.html#printf-style-string-formatting). –
Danke! Auch [hier] (https://stackoverflow.com/questions/28255411/python-what-does-the-two-signs-in-print-r-kka-do?rq=1) fand ich eine detaillierte Erklärung warum s %% s wird wie s% s gedruckt. –