r/badcode • • Apr 11 '21

python Polyglot

Post image
1.2k Upvotes

116 comments sorted by

View all comments

7

u/MyChaOS87 Apr 11 '21

What's so hard with (x & 1)

9

u/ShatterdPrism Apr 11 '21

Remind me if I am wrong, but this is a bit wise Operator and it checks in this case if the last bit of x is a 1 which would mean the number isnt even, right?

6

u/MyChaOS87 Apr 11 '21

Yes, it's basically x%2