Skip to content

Instantly share code, notes, and snippets.

@cloneko
Forked from typosone/odd_even.py
Last active August 29, 2015 14:03
Show Gist options
  • Save cloneko/ebb97cd2544a3f32f502 to your computer and use it in GitHub Desktop.
Save cloneko/ebb97cd2544a3f32f502 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
def isOdd(i):
return False if format(i,'b')[-1] == '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