Skip to content

Instantly share code, notes, and snippets.

@typosone
Created July 4, 2014 06:32
Show Gist options
  • Save typosone/1c5acaa2189284a81855 to your computer and use it in GitHub Desktop.
Save typosone/1c5acaa2189284a81855 to your computer and use it in GitHub Desktop.
てきとーに奇偶判定
#!/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