Jan-10-2019, 02:24 AM
"|" is the bitwise or operator. It compares the underlying bits of a value rather than the value itself.
Also, your conditional is incomplete. The first half will return 0 (False) when the number is divisible. It should be:
Also, your conditional is incomplete. The first half will return 0 (False) when the number is divisible. It should be:
is_divisible = lambda n,x,y : n % x == 0 | n % y == 0