Try to avoid using fancy library functions as much as possible.
To get the ball rolling, here's one in Python.
- Code: Select all
#! /usr/bin/env python
s='#! /usr/bin/env python\n\ns=%s\nprint s%%repr(s)'
print s%repr(s)
And a one line version that runs in the interpreter.
- Code: Select all
s='>>> s=%s;print s%%repr(s)';print s%repr(s)
If you think using the repr() function is cheating, feel free to post an alternative.
I'll post one or two in PostScript a bit later. I've got one in C here (written by someone else) that is also a palindrome!



