Created
July 11, 2020 22:11
-
-
Save spirosrap/9f24cb5e32ca104bb615b53abee827c1 to your computer and use it in GitHub Desktop.
Quine in python https://gist.github.com/grodtron/1426274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = [] | |
c.append('c = []') | |
c.append('f = lambda k: "c.append(" + repr(k) + ")"') | |
c.append('print(c[0])') | |
c.append('print(f(c[0]))') | |
c.append('for line in c[1:]:') | |
c.append(' print(f(line))') | |
c.append('for line in c[1:]:') | |
c.append(' print(line)') | |
f = lambda k: "c.append(" + repr(k) + ")" | |
print(c[0]) | |
print(f(c[0])) | |
for line in c[1:]: | |
print(f(line)) | |
for line in c[1:]: | |
print(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment