Python Forum

Full Version: a one line thing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
for fun, a challenge (but don't spill any beer): define 2 functions, a() and b() where a() calls b() and b() prints out "hello world", and call a(). not very challenging? do it in the python command line -c option.

* Skaperen predicts wavic will be the winner
python3 -c "a = lambda: b(); b = lambda: (print('Hello World'), a()); a()"

New Task: Do a similar thing without hitting the recursion limit.
i get that recursion, too. why use lambda instead of def?