Skip to content

Instantly share code, notes, and snippets.

@riceissa
Last active September 24, 2020 07:18
Show Gist options
  • Save riceissa/89ec7944883fe93b1d024d735a3bf6ae to your computer and use it in GitHub Desktop.
Save riceissa/89ec7944883fe93b1d024d735a3bf6ae to your computer and use it in GitHub Desktop.
old quine from 2018-04-23
def defined(v):
return "v = \"" + v.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n") + "\"\n\nprint(v)\n\nprint(defined(v))"
v = "def defined(v):\n return \"v = \\\"\" + v.replace(\"\\\\\", \"\\\\\\\\\").replace(\"\\\"\", \"\\\\\\\"\").replace(\"\\n\", \"\\\\n\") + \"\\\"\\n\\nprint(v)\\n\\nprint(defined(v))\"\n"
print(v)
print(defined(v))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment