Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mistaken
on July 9, 2021
|
parent
|
context
|
favorite
| on:
Functools – The Power of Higher-Order Functions in...
It's possible to execute statements in a lambda through exec. But it's more of hack than what it worth.
print((lambda x: [exec('x = x + 1; result = x'), eval('result')][1])(1))
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: