Created
July 4, 2014 06:32
-
-
Save typosone/1c5acaa2189284a81855 to your computer and use it in GitHub Desktop.
てきとーに奇偶判定
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
def isOdd(i): | |
return False if i & 0x1 == 0 else True | |
def isEven(i): | |
return not isOdd(i) | |
if __name__ == '__main__': | |
for x in range(100): | |
print(x, isEven(x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment