From 92e683e992612c5edb80a3587163d292ecfd19b9 Mon Sep 17 00:00:00 2001 From: Jeremias Moreira Gomes Date: Fri, 7 Oct 2022 19:33:20 -0300 Subject: [PATCH 1/2] Adding a Quine in Python. --- other/quine.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 other/quine.py diff --git a/other/quine.py b/other/quine.py new file mode 100644 index 000000000000..f305f6ba077d --- /dev/null +++ b/other/quine.py @@ -0,0 +1,10 @@ +#!/bin/python3 +""" +Quine: + +A quine is a computer program which takes no input and produces a copy of its +own source code as its only output (disregarding this docstring and the shebang). + +More info on: https://en.wikipedia.org/wiki/Quine_(computing) +""" +print((lambda quine: quine % quine)('print((lambda quine: quine %% quine)(%r))')) From 41e9b9e177ec13964765bc9d91bf7b632e3a867c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 7 Oct 2022 22:37:34 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- other/quine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/other/quine.py b/other/quine.py index f305f6ba077d..01e03bbb02cb 100644 --- a/other/quine.py +++ b/other/quine.py @@ -7,4 +7,4 @@ More info on: https://en.wikipedia.org/wiki/Quine_(computing) """ -print((lambda quine: quine % quine)('print((lambda quine: quine %% quine)(%r))')) +print((lambda quine: quine % quine)("print((lambda quine: quine %% quine)(%r))"))