h = [
lambda a, b, c, d: 0,
lambda a: 0,
lambda a, b, c, d, e, f, g, h: 0,
lambda a, b, c, d, e, f, g, h: 0,
lambda a, b, c, d, e, f, g, h, i, j, k: 0,
None,
lambda a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, t: 0,
lambda a, b, c, d, e, f, g, h, i, j, k, l: 0,
lambda a, b, c, d, e, f, g, h, i, j, k, l, m, n, o: 0,
lambda a, b, c, d, e, f, g, h, i: 0,lambda a: 0
]
b = 100
for i in h:
if i is None:
print(" ",end="")
b-=1
continue
try:
i()
except Exception as exc:
print(chr(int(str(exc).split(" ")[2])+b),end="")
This prints out "hello world" when ran. Explanation:
- the string is first encoded using deltas, to keep the numbers small, which will help us later
- each function is ran with no arguments, prompting Python to raise an error something like this:
<lambda>() missing 4 required positional arguments...
- take that error message, and the number in the middle is the value we're trying to get, add it to the initial value (100 for first word, 101 for second)
- each lambda then needs to have the number of arguments corresponding to each letter's delta (luckily all these numbers are small, because we used deltas)
Why? Because I can. If you think this is cool (or fascinatingly horrible), then you should check out a competition I am running in the vein of the IOCCC for Python.