this post was submitted on 15 Jul 2025
459 points (94.9% liked)

Programmer Humor

37249 readers
4 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] VitabytesDev 6 points 4 days ago* (last edited 3 days ago) (1 children)
def is_even(num):
    num = num & 1
    if num == 0:
        return False
    if num == 1:
        return True
    raise ValueError(f'what the fuck')

EDIT: forgor to edit the numbers

If you're waiting for "num & 1 == 2", you're going to be very disappointed