Write the shortest one-statement python quine

1

I wrote this one-line one-statement Python quine a little while back.

print (lambda x: x + str((x,)))('print (lambda x: x + str((x,)))',)

The point is, it's all one line, and one function (i.e. no semicolons). Does anyone have a shorter one like this?

Note: of course there's the empty file, but that's not what I mean. And, no reading the source file either, &c. Also, just to say explicitly, a quine of the type r='r=%r;print r%%r';print r%r from The Quine Page is multiple statements, so while it's cool, it isn't what I'm talking about here. (:

postylem

Posted 2014-09-12T12:36:33.757

Reputation: 119

Question was closed 2014-09-12T14:31:15.767

1I don't think so. I'm looking for a quine that doesn't use multiple statements. the ones in that post are multiple statements, like the example I gave. – postylem – 2014-09-12T12:46:32.970

1Not true. There's a single statement 54-char Python quine in that thread. – Peter Taylor – 2014-09-12T12:49:42.020

isn't it the winning python entry this: _='_=%r;print _%%_';print _%_? that's multiple statements right? – postylem – 2014-09-12T12:52:06.893

@postylem no this one: http://codegolf.stackexchange.com/a/25407/8478

– Martin Ender – 2014-09-12T12:53:14.633

Yours can be shortened to print(lambda x:x+\(x,)`)('print(lambda x:x+`(x,)`)',)` – flornquake – 2014-09-12T12:54:15.763

@MartinBüttner cool then. good find! – postylem – 2014-09-12T12:56:31.857

@flornquake right! and that's one character shorter than than this one that Martin gave.

– postylem – 2014-09-12T12:58:51.350

I'd put this just as a comment on Evpok's, and delete this question, but I don't have the cred. – postylem – 2014-09-12T15:18:10.710

@postylem I think your quine is interesting and different enough that you should simply put it as a new answer to that question. :) – flornquake – 2014-09-15T09:37:53.457

Thanks @flornquake. I'd do that, but it requires 10 reputation. I've got 4. I suppose I'll work up 6 more at some point, and then maybe remember to post. – postylem – 2014-09-15T12:53:03.850

No answers