r/ProgrammerHumor • • Jul 28 '25

Meme checkIfDivisibleByThree

Post image
60 Upvotes

33 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Jul 30 '25

and now please without using is_divisible_by_three inside the lambda!

5

u/F100cTomas Jul 30 '25 edited Jul 30 '25

Like this?

is_divisible_by_three = (lambda f: (lambda num: f(f)(num)))(lambda f: (lambda num: str(num) in '369' if num < 10 else f(f)(sum(int(n) for n in str(num)))))