DEV Community

Discussion on: Daily Challenge #255 - Is There an Odd Bit?

Collapse
 
anupa profile image
Anup Aglawe • Edited

Simple Python solution

def any_odd(num): // 45812984490 = b(1010101....10)
  return 0 if ((45812984490 & num) == 0) else 1

print(any_odd(5))