Skip to content

Instantly share code, notes, and snippets.

@Wingless-Archangel
Created November 5, 2016 03:03
Show Gist options
  • Save Wingless-Archangel/a7274d72cb908ee64f1d1d266b44b29f to your computer and use it in GitHub Desktop.
Save Wingless-Archangel/a7274d72cb908ee64f1d1d266b44b29f to your computer and use it in GitHub Desktop.
determine the odd and even number from input
#!/usr/bin/python3
import sys
def main():
num = input("please enter the number : ")
if num.isnumeric() != True:
print("Please enter the number")
sys.exit(1)
if num % 2 == 0:
print("this number is even")
else:
print("this number is odd")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment