4 ms·
Nice :) Today it's possible to do a lot of it with vanilla Python (sortof): something(lambda x: [ x2 := x + 10, # define variables [ print(f"Nu
by exyi 2y ago
Nice :) Today it's possible to do a lot of it with vanilla Python (sortof):
something(lambda x: [
x2 := x + 10, # define variables
[ print(f"Number: {i})
for i in range(x) ], # loop
[ 0 for i in range(x)
if print(f"Number: {i}") or True
if print(f"Second line: {i}") ], # loop if you prefer "normal code order"
0 if x > 0 else {}[f'{n} should be positive'], # conditions and asserts (throws KeyError, but includes the error message)
x2 * 2 # return
][-1])
note: I'm not responsible for coworkers injuring you after committing this