A
Aurélien Géron
Hi all,
As a newly converted Python lover, I am impressed at how concise Python code
actually is. But really... how concise can it GET?
As an experiment to find out the very limits of Python, I'm generously
offering a free smiley as well as my utmost and sincere admiration to
whoever can come up with the shortest python module which can print itself
(no file reading allowed).
I tried:
print "print"
But found out I got it wrong when it just displayed:
print
Duh... (I thought). So I tried:
print "print \"print\""
But I was stunned to find that this just printed:
print "print"
Hang on, this could last forever, like the "GNU" thingy! I'm sure you can
do better than that!
BTW, maybe this is a well-known problem. Anybody heard of it before? Looks
like some problem out of "Goedel, Escher, Bach" (Hofstadter), although I
frankly never got to the end of that book (something in it got you back to
chapter one just when you thought you had reached chapter two)...
Maybe we should try to do the same with C, Java, Lisp, Smalltalk, Prolog...
and check the size difference. How fun!
I smile in your general direction,
Aurélien
ps: hope this sort of post is allowed in this newsgroup... maybe there's a
geek.lang.python newsgroup somewhere which would be more appropriate?
As a newly converted Python lover, I am impressed at how concise Python code
actually is. But really... how concise can it GET?
As an experiment to find out the very limits of Python, I'm generously
offering a free smiley as well as my utmost and sincere admiration to
whoever can come up with the shortest python module which can print itself
(no file reading allowed).
I tried:
print "print"
But found out I got it wrong when it just displayed:
Duh... (I thought). So I tried:
print "print \"print\""
But I was stunned to find that this just printed:
print "print"
Hang on, this could last forever, like the "GNU" thingy! I'm sure you can
do better than that!
BTW, maybe this is a well-known problem. Anybody heard of it before? Looks
like some problem out of "Goedel, Escher, Bach" (Hofstadter), although I
frankly never got to the end of that book (something in it got you back to
chapter one just when you thought you had reached chapter two)...
Maybe we should try to do the same with C, Java, Lisp, Smalltalk, Prolog...
and check the size difference. How fun!
I smile in your general direction,
Aurélien
ps: hope this sort of post is allowed in this newsgroup... maybe there's a
geek.lang.python newsgroup somewhere which would be more appropriate?