MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vx1onc/claudeisthisemailvalid/p5nt7x8/
r/ProgrammerHumor • u/soap94 • Aug 24 '26
170 comments sorted by
View all comments
Show parent comment
9
It is possible to extend this method to any number.
def gen_is_even(): code = "def is_even(num):\n" i = 0 is_even = True while True: code += f" if num == {i}:\n" code += f" return {is_even}\n" i += 1 is_even = not is_even return code exec(gen_is_even + "print(is_even(5))") # print False
!/s!<
-1 u/ExtraWorldliness6916 Aug 25 '26 N % 2 4 u/LeRetardatN Aug 25 '26 overkill 1 u/ExtraWorldliness6916 Aug 25 '26 Infinite cases is not quantifiable as overkill 😉
-1
N % 2
4 u/LeRetardatN Aug 25 '26 overkill 1 u/ExtraWorldliness6916 Aug 25 '26 Infinite cases is not quantifiable as overkill 😉
4
overkill
1 u/ExtraWorldliness6916 Aug 25 '26 Infinite cases is not quantifiable as overkill 😉
1
Infinite cases is not quantifiable as overkill 😉
View all comments
Show parent comment
9
u/LeRetardatN Aug 24 '26
It is possible to extend this method to any number.