Q7 (Python):
Y = lambda s: eval(s)(s)Y(‘lambda s: print(“Y = lambda s: eval(s)(s)\\nY({s!r})”)’)
Q8 (Python):
Not sure about the interpretation of this one. Here’s a way to have it work for any fixed (python function) f:
f = ‘lambda s: “\\n”.join(s.splitlines()[::-1])’
go = ‘lambda s: print(eval(f)(eval(s)(s)))’
eval(go)(‘lambda src: f”f = {f!r}\\ngo = {go!r}\\neval(go)({src!r})”’)
Q7 (Python):
Y = lambda s: eval(s)(s)
Y(‘lambda s: print(“Y = lambda s: eval(s)(s)\\nY({s!r})”)’)
Q8 (Python):
Not sure about the interpretation of this one. Here’s a way to have it work for any fixed (python function) f:
f = ‘lambda s: “\\n”.join(s.splitlines()[::-1])’
go = ‘lambda s: print(eval(f)(eval(s)(s)))’
eval(go)(‘lambda src: f”f = {f!r}\\ngo = {go!r}\\neval(go)({src!r})”’)