mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Update is_even.py (#8028)
This commit is contained in:
parent
40f165b789
commit
af8d520922
|
@ -11,7 +11,7 @@ def is_even(number: int) -> bool:
|
|||
from the above examples we can observe that
|
||||
for all the odd integers there is always 1 set bit at the end
|
||||
also, 1 in binary can be represented as 001, 00001, or 0000001
|
||||
so for any odd integer n => n&1 is always equlas 1 else the integer is even
|
||||
so for any odd integer n => n&1 is always equals 1 else the integer is even
|
||||
|
||||
>>> is_even(1)
|
||||
False
|
||||
|
|
Loading…
Reference in New Issue
Block a user